Definition KeywordsMisc

Applies to:uCalc Fast Math Parser
List of keywords for Define
Remarks
The following is a list of keywords for use with Define. Capitalization of the keyword does not matter. If a property value is being set, then the keyword is followed by a colon, and then the value. If the the property does not take a value, then you enter just the property. Multiple parts of the definition are separated by a configurable delimiter, which by default is ~~.
Keyword Description
Address Address of item being defined. This can for instance be the address of a callback function or a variable in your source code.
Example:
          double MyVar = 123;
          uc.Define("Variable: MyVar As Double ~~ Address: ", (void *)&MyVar);
        

AnyType
ApiCall
Begin
Boolean Sets string values that evaluate to True and False, as well as the numeric value returned for True.
Example:
          uc.Define("Boolean: 1, True, False");
          Result = uc.Eval("True Or False");

          uc.Define("Boolean: -1, ON, OFF");
          Result = uc.Eval("ON Or OFF");
        

For instance, if you want the word YES to evaluate to true, and NO to evaluate to false, and you want the numeric value for TRUE to be 1 (as opposed to -1), then you would set it as Boolean: 1, YES, NO
Bootstrap
ByExpr
ByHandle
ByRef
ByVal
CaseSensitive CaseSensitive: true, makes the current uCalc instance case sensitive.
ChangeMulti ChangeMulti is the inverse setting of ChangeOnce
ChangeOnce ChangeOnce causes the a transformation to happen only once and then move on, otherwise the changed expression is parsed again until no further changes are possible. ChangeOnce is the inverse setting of ChangeMulti.
CheckForStop
Class
CodeblockSensitive
CodePostfix
CodePrefix
ConvertsBetween Defines a group of compatible datatypes such that a value can be converted from any data type in the group to any other data type in the group
Example:
          uc.Define("ConvertsBetween: Bool, Int8, Int8u, Int16, Int16u, Int, Int32u, Int64, Int64u, Float, Double, Size_t");
        

ConvertsFrom List of data types that the current one can be converted from.
Example:
Define("DataType: Complex ~~ ConvertsFrom: Bool, Int8, Int8u, Int16, Int16u, Int, Int32u, Int64, Int64u, Float, Double, Size_t");

ConvertsFromAddr
ConvertsFromAny Allows any data type to convert to this one (can be useful for types like String)
Example:
          Define("DataType: OmniType ~~ ConvertsFromAny ~~ ConvertsToAny");
        

ConvertsFromType
ConvertsTo List of data types that the current one can be converted to
ConvertsToAddr
ConvertsToAny Allows this type to be converted to any other
ConvertsToType
Count
DataType 1. Assigns a data type to the item currently being defined,
Example:
Define("Token: '([^']*)' ~~ SubMatch: 1 ~~ TokenType: Literal ~~ QuotedText ~~ DataType: String");

Or 2. Defines a datatype You must supply the name you want uCalc to associate with the data type, and an element from BuiltInTypesEnum. For end-user types, use Type_UserDefined. To construct a datatype at the same level as built-in data types, use Type_Intrinsic
Example:
Define("DataType: Integer : Type_Integer_32");

Or 3. Assigns properties to the given data type
Example:
Define("DataType: Complex ~~ ConvertsFrom: Float, Double");

Default Sets properties as the default
Example:
          uc.Define("Default ~~ DataType: String");
          auto MyVariable = uc.DefineVariable("MyVariable");
          ResultStr = MyVariable.DataType().Name(); // Returns String
        

DefSeparator This sets the string of characters that delimit parts of a definition. ~~ is the default.
DefSpace
EndMatch Sets the matching token in a token definition. Some tokens are defined as a pair. For instance, parentheses are defined internally with an opening parenthesis, and a matching closing parenthesis as follows:
Example:
Define("Token: \\( ~~ EndMatch: \\)");

ErrorHandler Defines an error handler. The AddErrorHandler function consists of a call to Define with this keyword.
EvalSpace
Exec
ExitFile
ExternalKeywords
From
FuncBody
Function Defines a function. DefineFunction consists of a call to Define with this keyword.
Grouping Sets the grouping attribute of an operator or syntax construct. Although operators are defined with the default LeftToRight setting, this property can be set to RightToLeft
If
IfDef
IfFileOption
IfnDef
IgnoreOutput
Include
Inline
IsUnion
Label
LineContinue
Lock Locking an item prevents it from being redefined. DefineConstant uses this.
Max
MaxSoft
Min
MinSoft
Mode
Name Sets the name of the item currently being defined.
Namespace Sets a namespace. First, give it a name. Then set the namespace property to Begin. All subsequent definitions will go into this namespace until you issue namespace definition with the property set to End.
Example:
          uc.Define("Name: a ~~ Namespace: begin"); {
          uc.DefineVariable("MyVar = 111");
          uc.Define("Name: nested ~~ Namespace: begin"); {
          uc.DefineVariable("MyVar = 222");
          } uc.Define("Namespace: end");
          } uc.Define("Namespace: end");
          uc.Define("Name: b ~~ Namespace: begin"); {
          uc.DefineVariable("MyVar = 333");
          } uc.Define("Namespace: end");

          Result = uc.Eval("a.MyVar");         // Returns 111
          Result = uc.Eval("a.nested.MyVar");  // Returns 222
          Result = uc.Eval("b.MyVar");         // Returns 333
        

NewLine
NextDef
Operator
Output See SetOutput which consists of a call to: Define("Output:" + Definition, Address);
Overhead
Overwrite
Param
Pass
PassOnce
Path
Precedence Sets the precedence level of the operator or sytax construct being defined.
Example:
          uc.Define("Precedence: 50 ~~ Operator: {x} PLUS {y} = x + y");
          uc.Define("Precedence: Precedence('*') ~~ Operator: {x} TIMES {y} = x * y");
          Result = uc.Eval("20 PLUS 5");
          Result = uc.Eval("20 TIMES 5");
        

Property
QuotedText
QuotesenSitive
Rank
RepassAll
RepassLocal
RightToLeft
RunFile
Size
SkipOver
StartAfter
StopAfter
SubMatch Selects the part of the token that represents literal data.
Example:
Define("Token: '([^']*)' ~~ SubMatch: 1 ~~ TokenType: Literal ~~ QuotedText ~~ DataType: String");

Syntax For defining Syntax Constructs.
Example:
Define("Syntax: This ::= That")

SyntaxArg
SyntaxEqual Sets the delimiter that separates the From part from the To part when defining Syntax Constructs. The default is ::=
TextData
Thread
To
Token Defines a token.
TokenType
Type
TypeHandler
uCalc
Value
Variable For defining variables and constants.
VariableArgList
Prev | Next