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; } }
public NodeInfo(bool hasValue) { HasValue = hasValue; InfixOperator = false; PrefixOperator = false; InfixOperatorType = ASTNode.NodeType.Invalid; PrefixOperatorType = ASTNode.NodeType.Invalid; InfixOperatorPrecedence = -1; PrefixOperatorPrecedence = -1; }
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; }
public InvalidOperandsException(ASTNode.NodeType type, SourceRef location) : base("Invalid operand(s) for operator type \"" + type + "\"", location) { }
public ExpectedNodeException(ASTNode.NodeType expected, ASTNode.NodeType got, SourceRef location) : base("Expected \"" + expected + "\" but got \"" + got + "\"", location) { }
public NoCodeGenerationForNodeException(ASTNode.NodeType type, SourceRef location) : base("No code generation available for node type \"" + type + "\"", location) { }
public NoInfoForNodeException(ASTNode.NodeType type, SourceRef location) : base("No information available for node \"" + type + "\"", location) { }