public RpnCompiler(HostCallTable functionTable)
        {
            m_FunctionTable = functionTable;
               // m_HostSymbolTable = hostSymbolTable;
            m_SemanticAnalyser = new SemanticAnalyser(m_FunctionTable);

            Tokenizer.AddToken(new Token(new Regex(Regex.Escape("&&")), TokenType.LogicalAnd));
            Tokenizer.AddToken(new Token(new Regex(Regex.Escape("||")), TokenType.LogicalOr));
            Tokenizer.AddToken(new Token(new Regex(Regex.Escape(">=")), TokenType.GreaterThanOrEqualTo));
            Tokenizer.AddToken(new Token(new Regex(Regex.Escape("<=")), TokenType.LessThanOrEqualTo));
            Tokenizer.AddToken(new Token(new Regex(Regex.Escape("==")), TokenType.Equal));
            Tokenizer.AddToken(new Token(new Regex(Regex.Escape("!=")), TokenType.NotEqual));
            Tokenizer.AddToken(new Token(new Regex(Regex.Escape(">")), TokenType.GreaterThan));
            Tokenizer.AddToken(new Token(new Regex(Regex.Escape("<")), TokenType.LessThan));
            Tokenizer.AddToken(new Token(new Regex(Regex.Escape("^")), TokenType.PowerOf));
            Tokenizer.AddToken(new Token(new Regex(Regex.Escape("/")), TokenType.Divide));
            Tokenizer.AddToken(new Token(new Regex(Regex.Escape("%")), TokenType.Modulo));
            Tokenizer.AddToken(new Token(new Regex(Regex.Escape("*")), TokenType.Multiply));
            Tokenizer.AddToken(new Token(new Regex(Regex.Escape("+")), TokenType.Add));
            Tokenizer.AddToken(new Token(new Regex(Regex.Escape("-")), TokenType.Subtract));
            Tokenizer.AddToken(new Token(new Regex(Regex.Escape("!")), TokenType.Negation));
            Tokenizer.AddToken(new Token(new Regex(Regex.Escape("(")), TokenType.OpenBracket, OperationType.Operand));
            Tokenizer.AddToken(new Token(new Regex(Regex.Escape(")")), TokenType.CloseBracket, OperationType.Operand));
        }
 public SemanticAnalyser(HostCallTable hostCallTable)
 {
     m_HostCallTable = hostCallTable;
     m_HostSymbolTable = new HostSymbolTable();
 }
Exemple #3
0
 public ExpressionCompiler(HostCallTable functionTable)
 {
     m_FunctionTable = functionTable;
     // m_HostSymbolTable = hostSymbolTable;
     m_SemanticAnalyser = new SemanticAnalyser(m_FunctionTable);
 }
Exemple #4
0
 public SemanticAnalyser(HostCallTable hostCallTable)
 {
     m_HostCallTable   = hostCallTable;
     m_HostSymbolTable = new HostSymbolTable();
 }