Esempio n. 1
0
 public NodeInfo(
     bool hasValue, bool infixOperator, bool prefixOperator, ASTNode.NodeType operatorType,
     int operatorPrecedence
     )
 {
     HasValue       = hasValue;
     InfixOperator  = infixOperator;
     PrefixOperator = prefixOperator;
     if (InfixOperator)
     {
         InfixOperatorType        = operatorType;
         PrefixOperatorType       = ASTNode.NodeType.Invalid;
         InfixOperatorPrecedence  = operatorPrecedence;
         PrefixOperatorPrecedence = -1;
     }
     else if (PrefixOperator)
     {
         InfixOperatorType        = ASTNode.NodeType.Invalid;
         PrefixOperatorType       = operatorType;
         InfixOperatorPrecedence  = -1;
         PrefixOperatorPrecedence = operatorPrecedence;
     }
     else
     {
         InfixOperatorType        = ASTNode.NodeType.Invalid;
         PrefixOperatorType       = ASTNode.NodeType.Invalid;
         InfixOperatorPrecedence  = -1;
         PrefixOperatorPrecedence = -1;
     }
 }
Esempio n. 2
0
 public NodeInfo(bool hasValue)
 {
     HasValue                 = hasValue;
     InfixOperator            = false;
     PrefixOperator           = false;
     InfixOperatorType        = ASTNode.NodeType.Invalid;
     PrefixOperatorType       = ASTNode.NodeType.Invalid;
     InfixOperatorPrecedence  = -1;
     PrefixOperatorPrecedence = -1;
 }
Esempio n. 3
0
 public NodeInfo(
     bool hasValue, bool infixOperator, bool prefixOperator, ASTNode.NodeType infixOperatorType,
     int infixOperatorPrecedence, ASTNode.NodeType prefixOperatorType, int prefixOperatorPrecedence
     )
 {
     HasValue                 = hasValue;
     InfixOperator            = infixOperator;
     PrefixOperator           = prefixOperator;
     InfixOperatorType        = infixOperatorType;
     PrefixOperatorType       = prefixOperatorType;
     InfixOperatorPrecedence  = infixOperatorPrecedence;
     PrefixOperatorPrecedence = prefixOperatorPrecedence;
 }
Esempio n. 4
0
 public InvalidOperandsException(ASTNode.NodeType type, SourceRef location) :
     base("Invalid operand(s) for operator type \"" + type + "\"", location)
 {
 }
Esempio n. 5
0
 public ExpectedNodeException(ASTNode.NodeType expected, ASTNode.NodeType got, SourceRef location) :
     base("Expected \"" + expected + "\" but got \"" + got + "\"", location)
 {
 }
Esempio n. 6
0
 public NoCodeGenerationForNodeException(ASTNode.NodeType type, SourceRef location) :
     base("No code generation available for node type \"" + type + "\"", location)
 {
 }
Esempio n. 7
0
 public NoInfoForNodeException(ASTNode.NodeType type, SourceRef location) :
     base("No information available for node \"" + type + "\"", location)
 {
 }