Content


NTL
Core
generic::CExpressionBuilder

generic::CExpressionBuilder


Class implements generic expression builder.

You can find more information in comments below. Overrided methods can be found in corresponding base class or interface.

class CExpressionBuilder :public virtual IExpressionBuilder, public virtual CReleasable
{
public:
    IErrorListener* &ErrorListener; // Error listener or nullptr 
    StringKeyValueArray &CastOperators; // Default: "(". If empty, casts disabled 
    StringKeyValueArray &CallOperators; // Default: "(". If empty, calls disabled 
    StringKeyValueArray &BraceOperators; // Default: "{". If empty, brace blocks disabled 
    StringKeyValueArray &SubscriptOperators; // Default: "[". If empty, subscripts disabled 
    StringArray &Comments; // Default: "/*" and "//". If empty, comments disabled 
    StringArray &Pointers; // Default: "*" and "&". If empty, no pointers allowed 
    StringArray &TrueKeywords; // Default: "true". If empty, "true" is treated as identifier otherwise as "true" literal 
    StringArray &FalseKeywords; // Default: "false". If empty, "false" is treated as identifier otherwise as "false" literal 
    StringArray &NullKeywords; // Default: "nullptr". If empty, "nullptr" is treated as identifier otherwise as "nullptr" literal 
    StringArray &DataTypes; // Default: { "bool", "double", "float", "int", "int64", "Integer", "String" }. If empty, casts disabled 
    StringArray &MemberAccessOperators; // Default: "::", "." and "->" 
    bool &CaseSensitive; // Whether case match is required during keyword recognition. Default: true 
    bool &AllowUserDefinedLiterals; // Whether user-defined literals allowed after integers, floats and strings (identifier after integer, float, string token). Default: true 
    bool &AllowStringConcatenation; // Whether strings standing near each other should be treated as one string. Default: true 
    bool &AllowPrecedence; // Whether sequences should be re-arranged accordingly to operators precedence order. Default: true 
    std::vector<uint> &SkipGroups; // Operator group ids which should be ignored. Default: { GROUP_SPACE, GROUP_NEW_LINE, GROUP_SEPARATOR } 
    String &TernaryOperator1; // First part of ternary operator. Default: "?". If empty, no ternary wrapping allowed 
    String &TernaryOperator2; // Second part of ternary operator. Default: ":". If empty, no ternary wrapping allowed 

    // IExpressionBuilder methods 
    bool Build(ITokenizer *tokenizer, IExpression **target) override;
    bool Build(const Tokens &tokens, IExpression **target) override;
    bool Build(const Tokens &tokens, const size_t first, const size_t last, IExpression **target) override;

    CExpressionBuilder();
};
Namespace: nitisa::script::generic
Include: Nitisa/Modules/Script/ExpressionBuilders/Generic/ExpressionBuilder.h