uCalc API Version: 2.1.3-preview.2 Released: 6/16/2026

Warning

uCalc API Preview Release Notice:The documentation describes the intended behavior of the API. The current preview build contains incomplete features, unoptimized performance, and is subject to breaking changes.

Introduction

Product: 

Class: 

ItemsAccessor

Provides an iterable, queryable interface to the collection of all symbols (items) defined within a uCalc instance.

Remarks

🔍 ItemsAccessor: The Symbol Table Gateway

The ItemsAccessor class is the modern, object-oriented gateway to a uCalc instance's symbol table. It is not created directly; instead, you retrieve it from the uCalc.Items property. It provides a powerful and flexible way to query, inspect, and iterate through all defined symbols—such as functions, variables, and operators—within a specific parser context.


Class Members

The ItemsAccessor behaves like a read-only collection, providing the following primary members:

MemberDescription
Count (Property)Gets the total number of items in the collection.
Indexer [index]Retrieves an item by its zero-based numerical index.
Indexer [name]Retrieves the first item that matches the given string name.
(Iteration)The object directly supports foreach loops to iterate over all Item objects.

Filtering Items

While the accessor returns all items by default, you can easily filter the collection within a loop by checking each item's properties using Item.IsProperty.

// Example: Find and print only the variablesforeach(var item in uc.Items) {  if (item.IsProperty(ItemIs.Variable)) {    Console.WriteLine($"{item.Name} = {item.ValueStr()}");  }}

🆚 Comparative Analysis

  • vs. .NET IEnumerable<T>: The ItemsAccessor is conceptually very similar to a standard .NET collection interface. It supports foreach and indexed access, making it intuitive for C# and VB.NET developers.

Examples

ListOfItem with name / property
				
					using uCalcSoftware;

var uc = new uCalc();
Console.WriteLine("Items with the Prefix property");
Console.WriteLine("------------------------------");
foreach(var item in uc.GetItems(ItemIs.Prefix)) {
   Console.WriteLine(item.Name);
}

Console.WriteLine("");
Console.WriteLine("Different versions of the + operator");
Console.WriteLine("------------------------------------");
foreach(var item in uc.GetItems("+")) {
   Console.WriteLine(item.Text);
}
				
			
Items with the Prefix property
------------------------------
!
+
-
not
~

Different versions of the + operator
------------------------------------
Operator: 70 +{x}
Operator: 50 {x} + {y}
Operator: 50 {x As Int} + {y As Int} As Int
Operator: 50 {x As String} + {y As String} As String
Operator: 50 {x As Complex} + {y As Complex} As Complex
Operator: 50 {ByHandle x As AnyType Ptr} + {y As Int} As SameTypeAs:0 Ptr
Operator: 50 {ByHandle x As AnyType} + {ByHandle y As String} As String
Operator: 50 {ByHandle x As String} + {ByHandle y As AnyType} As String
				
					#include <iostream>
#include "uCalc.h"

using namespace std;
using namespace uCalcSoftware;

int main() {
   uCalc uc;
   cout << "Items with the Prefix property" << endl;
   cout << "------------------------------" << endl;
   for(auto item : uc.GetItems(ItemIs::Prefix)) {
      cout << item.Name() << endl;
   }

   cout << "" << endl;
   cout << "Different versions of the + operator" << endl;
   cout << "------------------------------------" << endl;
   for(auto item : uc.GetItems("+")) {
      cout << item.Text() << endl;
   }
}
				
			
Items with the Prefix property
------------------------------
!
+
-
not
~

Different versions of the + operator
------------------------------------
Operator: 70 +{x}
Operator: 50 {x} + {y}
Operator: 50 {x As Int} + {y As Int} As Int
Operator: 50 {x As String} + {y As String} As String
Operator: 50 {x As Complex} + {y As Complex} As Complex
Operator: 50 {ByHandle x As AnyType Ptr} + {y As Int} As SameTypeAs:0 Ptr
Operator: 50 {ByHandle x As AnyType} + {ByHandle y As String} As String
Operator: 50 {ByHandle x As String} + {ByHandle y As AnyType} As String
				
					Imports System
Imports uCalcSoftware
Public Module Program
   Public Sub Main()
      Dim uc As New uCalc()
      Console.WriteLine("Items with the Prefix property")
      Console.WriteLine("------------------------------")
      For Each item In uc.GetItems(ItemIs.Prefix)
         Console.WriteLine(item.Name)
      Next
      
      Console.WriteLine("")
      Console.WriteLine("Different versions of the + operator")
      Console.WriteLine("------------------------------------")
      For Each item In uc.GetItems("+")
         Console.WriteLine(item.Text)
      Next
   End Sub
End Module
				
			
Items with the Prefix property
------------------------------
!
+
-
not
~

Different versions of the + operator
------------------------------------
Operator: 70 +{x}
Operator: 50 {x} + {y}
Operator: 50 {x As Int} + {y As Int} As Int
Operator: 50 {x As String} + {y As String} As String
Operator: 50 {x As Complex} + {y As Complex} As Complex
Operator: 50 {ByHandle x As AnyType Ptr} + {y As Int} As SameTypeAs:0 Ptr
Operator: 50 {ByHandle x As AnyType} + {ByHandle y As String} As String
Operator: 50 {ByHandle x As String} + {ByHandle y As AnyType} As String
uCalc.Items
				
					using uCalcSoftware;

var uc = new uCalc();
// Note: Some items in this list (like bool, or int*) appear more than once or out of chronological
// order because they are aliases (like bool, which is also an alias for boolean)
foreach(var item in uc.Items) {
   Console.WriteLine(item.Name);
}
				
			
!
%
&
&&
*
+
,
-
/
<
<<
<=
<>
=
==
>
>=
>>
\
^
_enduserformattedoutput
_newline
_token_alphanumeric
_token_argseparator
_token_binaryhexoctalnotation
_token_catchall
_token_catchall_utf8_other
_token_curlybrace
_token_curlybrace_close
_token_floatnumber
_token_imaginaryunit
_token_line
_token_memberaccess
_token_newline
_token_parenthesis
_token_parenthesis_close
_token_punctuation
_token_quotechar
_token_quotechar_double
_token_quotechar_single
_token_quotechar_tripledouble
_token_reducible
_token_reducible2
_token_semicolon
_token_squarebracket
_token_squarebracket_close
_token_string_doublequoted
_token_string_singlequoted
_token_string_tripledoublequoted
_token_stringinterpolationquote
_token_variableargs
_token_whitespace
_ucalc_lib_is32
_ucalc_lib_is64
_ucalc_lib_release_timestamp
_ucalc_lib_version
abs
acos
acosh
addptr
addressof
and
andalso
anytype
append
append_copy
arg
argcount
asc
asin
asinh
atan
atan2
atanh
back
baseconvert
bin
bitand
bitor
bool
bool
int8u
c_str
cbrt
ceil
chr
clear
compare
complex
conj
contains
copysign
cos
cosh
define
doloop
double
endswith
erase
erase_copy
erf
erfc
error
eval
evalstr
evaluate
evaluateint
evaluatestr
exp
exp2
expm1
exprptr
fabs
false
fdim
file
filesize
fill
find_first_not_of
find_first_of
find_last_not_of
find_last_of
single
floor
fmax
fmin
fmod
forloop
format
fpclassify
frac
frexp
fromto
goto
hex
hypot
iif
ilogb
imag
indexof
inf
insert
insert_copy
int
int16
int16u
int
int32u
int64
int64u
int8
int8u
int
isfinite
isinf
isnan
isnormal
lastindexof
lastrandomnumber
lcase
ldexp
length
lgamma
llrint
llround
log
log10
log1p
log2
logb
lrint
lround
ltrim
max
min
mod
modf
nan
nearbyint
nextafter
nexttoward
norm
not
oct
omnitype
or
orelse
padleft
padright
parse
pointer
polar
pop
pow
precedence
proj
push
rand
randfromsameseed
randomnumber
randomseed
real
remainder
remquo
repeat
replace
replace_copy
reset
rint
round
rtrim
sametypeas
scalbln
scalbn
setvar
sgn
signbit
sin
single
sinh
size_t
sizeof
sort
sqr
sqrt
startswith
str
string
substr
subtractptr
swap
tan
tanh
tgamma
trim
true
trunc
ucalcinstance
ucase
valueat
valueattype
void
xor
|
||
~
				
					#include <iostream>
#include "uCalc.h"

using namespace std;
using namespace uCalcSoftware;

int main() {
   uCalc uc;
   // Note: Some items in this list (like bool, or int*) appear more than once or out of chronological
   // order because they are aliases (like bool, which is also an alias for boolean)
   for(auto item : uc.Items()) {
      cout << item.Name() << endl;
   }
}
				
			
!
%
&
&&
*
+
,
-
/
<
<<
<=
<>
=
==
>
>=
>>
\
^
_enduserformattedoutput
_newline
_token_alphanumeric
_token_argseparator
_token_binaryhexoctalnotation
_token_catchall
_token_catchall_utf8_other
_token_curlybrace
_token_curlybrace_close
_token_floatnumber
_token_imaginaryunit
_token_line
_token_memberaccess
_token_newline
_token_parenthesis
_token_parenthesis_close
_token_punctuation
_token_quotechar
_token_quotechar_double
_token_quotechar_single
_token_quotechar_tripledouble
_token_reducible
_token_reducible2
_token_semicolon
_token_squarebracket
_token_squarebracket_close
_token_string_doublequoted
_token_string_singlequoted
_token_string_tripledoublequoted
_token_stringinterpolationquote
_token_variableargs
_token_whitespace
_ucalc_lib_is32
_ucalc_lib_is64
_ucalc_lib_release_timestamp
_ucalc_lib_version
abs
acos
acosh
addptr
addressof
and
andalso
anytype
append
append_copy
arg
argcount
asc
asin
asinh
atan
atan2
atanh
back
baseconvert
bin
bitand
bitor
bool
bool
int8u
c_str
cbrt
ceil
chr
clear
compare
complex
conj
contains
copysign
cos
cosh
define
doloop
double
endswith
erase
erase_copy
erf
erfc
error
eval
evalstr
evaluate
evaluateint
evaluatestr
exp
exp2
expm1
exprptr
fabs
false
fdim
file
filesize
fill
find_first_not_of
find_first_of
find_last_not_of
find_last_of
single
floor
fmax
fmin
fmod
forloop
format
fpclassify
frac
frexp
fromto
goto
hex
hypot
iif
ilogb
imag
indexof
inf
insert
insert_copy
int
int16
int16u
int
int32u
int64
int64u
int8
int8u
int
isfinite
isinf
isnan
isnormal
lastindexof
lastrandomnumber
lcase
ldexp
length
lgamma
llrint
llround
log
log10
log1p
log2
logb
lrint
lround
ltrim
max
min
mod
modf
nan
nearbyint
nextafter
nexttoward
norm
not
oct
omnitype
or
orelse
padleft
padright
parse
pointer
polar
pop
pow
precedence
proj
push
rand
randfromsameseed
randomnumber
randomseed
real
remainder
remquo
repeat
replace
replace_copy
reset
rint
round
rtrim
sametypeas
scalbln
scalbn
setvar
sgn
signbit
sin
single
sinh
size_t
sizeof
sort
sqr
sqrt
startswith
str
string
substr
subtractptr
swap
tan
tanh
tgamma
trim
true
trunc
ucalcinstance
ucase
valueat
valueattype
void
xor
|
||
~
				
					Imports System
Imports uCalcSoftware
Public Module Program
   Public Sub Main()
      Dim uc As New uCalc()
      '// Note: Some items in this list (like bool, or int*) appear more than once or out of chronological
      '// order because they are aliases (like bool, which is also an alias for boolean)
      For Each item In uc.Items
         Console.WriteLine(item.Name)
      Next
   End Sub
End Module
				
			
!
%
&
&&
*
+
,
-
/
<
<<
<=
<>
=
==
>
>=
>>
\
^
_enduserformattedoutput
_newline
_token_alphanumeric
_token_argseparator
_token_binaryhexoctalnotation
_token_catchall
_token_catchall_utf8_other
_token_curlybrace
_token_curlybrace_close
_token_floatnumber
_token_imaginaryunit
_token_line
_token_memberaccess
_token_newline
_token_parenthesis
_token_parenthesis_close
_token_punctuation
_token_quotechar
_token_quotechar_double
_token_quotechar_single
_token_quotechar_tripledouble
_token_reducible
_token_reducible2
_token_semicolon
_token_squarebracket
_token_squarebracket_close
_token_string_doublequoted
_token_string_singlequoted
_token_string_tripledoublequoted
_token_stringinterpolationquote
_token_variableargs
_token_whitespace
_ucalc_lib_is32
_ucalc_lib_is64
_ucalc_lib_release_timestamp
_ucalc_lib_version
abs
acos
acosh
addptr
addressof
and
andalso
anytype
append
append_copy
arg
argcount
asc
asin
asinh
atan
atan2
atanh
back
baseconvert
bin
bitand
bitor
bool
bool
int8u
c_str
cbrt
ceil
chr
clear
compare
complex
conj
contains
copysign
cos
cosh
define
doloop
double
endswith
erase
erase_copy
erf
erfc
error
eval
evalstr
evaluate
evaluateint
evaluatestr
exp
exp2
expm1
exprptr
fabs
false
fdim
file
filesize
fill
find_first_not_of
find_first_of
find_last_not_of
find_last_of
single
floor
fmax
fmin
fmod
forloop
format
fpclassify
frac
frexp
fromto
goto
hex
hypot
iif
ilogb
imag
indexof
inf
insert
insert_copy
int
int16
int16u
int
int32u
int64
int64u
int8
int8u
int
isfinite
isinf
isnan
isnormal
lastindexof
lastrandomnumber
lcase
ldexp
length
lgamma
llrint
llround
log
log10
log1p
log2
logb
lrint
lround
ltrim
max
min
mod
modf
nan
nearbyint
nextafter
nexttoward
norm
not
oct
omnitype
or
orelse
padleft
padright
parse
pointer
polar
pop
pow
precedence
proj
push
rand
randfromsameseed
randomnumber
randomseed
real
remainder
remquo
repeat
replace
replace_copy
reset
rint
round
rtrim
sametypeas
scalbln
scalbn
setvar
sgn
signbit
sin
single
sinh
size_t
sizeof
sort
sqr
sqrt
startswith
str
string
substr
subtractptr
swap
tan
tanh
tgamma
trim
true
trunc
ucalcinstance
ucase
valueat
valueattype
void
xor
|
||
~