/// <summary> /// Initializes a new instance of the <see cref="DeclarationNode"/> class. /// </summary> /// <param name="type">The type of the newly declared identifier.</param> /// <param name="id">The name of the newly declared identifier.</param> /// <param name="sourcePosition">The source position of the node in the program.</param> public DeclarationNode(TypeNode type, IdentifierNode id, SourcePosition sourcePosition) : base(sourcePosition) { Id = id; Type = type; }
/// <summary> /// Initializes a new instance of the <see cref="IntegerLiteral"/> class. /// </summary> /// <param name="sourcePosition">The source position of the node in the program.</param> public IntegerLiteral(string text, SourcePosition sourcePosition) : base(text, sourcePosition) { }
/// <summary> /// Initializes a new instance of the <see cref="DivisionNode"/> class. /// </summary> /// <param name="sourcePosition">The source position of the node in the program.</param> public DivisionNode(SourcePosition sourcePosition) : base(sourcePosition) { }
/// <summary> /// Initializes a new instance of the <see cref="CardTypeNode"/> class. /// </summary> /// <param name="sourcePosition">The source position of the node in the program.</param> public CardTypeNode(SourcePosition sourcePosition) : base(sourcePosition) { }
/// <summary> /// Initializes a new instance of the <see cref="GreaterThanNode"/> class. /// </summary> /// <param name="sourcePosition">The source position of the node in the program.</param> public GreaterThanNode(SourcePosition sourcePosition) : base(sourcePosition) { }
/// <summary> /// Initializes a new instance of the <see cref="Error"/> class. /// </summary> /// <param name="sourcePosition">The source position of the node in the program.</param> public Error(SourcePosition sourcePosition) { LineNumber = sourcePosition.LineNumber; CharPosition = sourcePosition.CharStartIndex; }
public IdentifiableNode(SourcePosition sourcePosition) : base(sourcePosition) { }
/// <summary> /// Initializes a new instance of the <see cref="MultiplicationNode"/> class. /// </summary> /// <param name="sourcePosition">The source position of the node in the program.</param> public MultiplicationNode(SourcePosition sourcePosition) : base(sourcePosition) { }
/// <summary> /// Initializes a new instance of the <see cref="CardValueExpressionNode"/> class. /// </summary> /// <param name="sourcePosition">The source position of the node in the program.</param> public CardValueExpressionNode(SourcePosition sourcePosition) : base(sourcePosition) { }
/// <summary> /// Initializes a new instance of the <see cref="IdentifiableNode"/> class. /// </summary> /// <param name="text">The name of the identifier.</param> /// <param name="sourcePosition">The source position of the node in the program.</param> public IdentifierNode(string text, SourcePosition sourcePosition) : base(text, sourcePosition) { }
/// <summary> /// Initializes a new instance of the <see cref="AdditionNode"/> class. /// </summary> /// <param name="sourcePosition">The source position of the node in the program.</param> public AdditionNode(SourcePosition sourcePosition) : base(sourcePosition) { }
/// <summary> /// Initializes a new instance of the <see cref="ElseIfNode"/> class. /// </summary> /// <param name="sourcePosition">The source position of the node in the program.</param> public ElseIfNode(SourcePosition sourcePosition) : base(sourcePosition) { }
/// <summary> /// Initializes a new instance of the <see cref="BoolLiteral"/> class. /// </summary> /// <param name="sourcePosition">The source position of the node in the program.</param> public BoolLiteral(string text, SourcePosition sourcePosition) : base(text, sourcePosition) { }
/// <summary> /// Initializes a new instance of the <see cref="CannotUseWithOperatorError"/> class. /// </summary> /// <param name="type">The type that was attempted to be used with the operator.</param> /// <param name="op">The operator used.</param> /// <param name="sourcePosition">The source position of the node in the program.</param> public CannotUseWithOperatorError(TypeNode type, InfixExpressionNode op, SourcePosition sourcePosition) : base(sourcePosition) { Message = $"Type '{type}' cannot be used with '{op}' operator."; }
/// <summary> /// Initializes a new instance of the <see cref="LessThanNode"/> class. /// </summary> /// <param name="sourcePosition">The source position of the node in the program.</param> public LessThanNode(SourcePosition sourcePosition) : base(sourcePosition) { }
public TerminalNode(string text, SourcePosition sourcePosition) : base(sourcePosition) { Text = text; }
/// <summary> /// Initializes a new instance of the <see cref="IsNode"/> class. /// </summary> /// <param name="sourcePosition">The source position of the node in the program.</param> public IsNode(SourcePosition sourcePosition) : base(sourcePosition) { }
/// <summary> /// Initializes a new instance of the <see cref="ProgNode"/> class. /// </summary> /// <param name="sourcePosition">The source position of the node in the program.</param> public ProgNode(SourcePosition sourcePosition) : base(sourcePosition) { Children = new List <ASTNode>(); }
/// <summary> /// Initializes a new instance of the <see cref="Error"/> class with a custom message. /// </summary> /// <param name="message">The error message to log.</param> /// <param name="sourcePosition">The source position of the node in the program.</param> public Error(string message, SourcePosition sourcePosition) { Message = message; LineNumber = sourcePosition.LineNumber; CharPosition = sourcePosition.CharStartIndex; }
public BaseTypeNode(SourcePosition sourcePosition) : base(sourcePosition) { }
public ExpressionNode(SourcePosition sourcePosition) : base(sourcePosition) { }
/// <summary> /// Initializes a new instance of the class <see cref="OrderedIdentifierNode"/>. /// </summary> /// <param name="text">The name of the identifier.</param> /// <param name="order">The order of the identifier</param> /// <param name="sourcePosition">The source position of the node in the program.</param> public OrderedIdentifierNode(string text, Order order, SourcePosition sourcePosition) : base(text, sourcePosition) { Order = order; }
/// <summary> /// Initializes a new instance of the <see cref="UndeclaredVariableError"/> class. /// </summary> /// <param name="variableName">The name of the referenced variable.</param> /// <param name="sourcePosition">The source position of the node in the program.</param> public UndeclaredVariableError(string variableName, SourcePosition sourcePosition) : base(sourcePosition) { Message = $"Undeclared variable: '{variableName}'."; }
public ControlStructureNode(SourcePosition sourcePosition) : base(sourcePosition) { }
/// <summary> /// Initializes a new instance of the <see cref="CountNode"/> class. /// </summary> /// <param name="sourcePosition">The source position of the node in the program.</param> public CountNode(SourcePosition sourcePosition) : base(new IdentifierNode("", sourcePosition)) { }
/// <summary> /// Initializes a new instance of the <see cref="TakeWhereActionNode"/> class. /// </summary> /// <param name="sourcePosition">The source position of the node in the program.</param> public TakeWhereActionNode(SourcePosition sourcePosition) : base(sourcePosition) { }
/// <summary> /// Initializes a new instance of the <see cref="PutActionNode"/> class. /// </summary> /// <param name="sourcePosition">The source position of the node in the program.</param> public PutActionNode(SourcePosition sourcePosition) : base(sourcePosition) { }
/// <summary> /// Initializes a new instance of the <see cref="IfNode"/> class. /// </summary> /// <param name="sourcePosition">The source position of the node in the program.</param> public IfNode(SourcePosition sourcePosition) : base(sourcePosition) { ElseIfChain = new List <ElseIfNode>(); }
/// <summary> /// Initializes a new instance of the <see cref="TakeAtActionNode"/> class. /// </summary> /// <param name="sourcePosition">The source position of the node in the program.</param> public TakeAtActionNode(SourcePosition sourcePosition) : base(sourcePosition) { }
/// <summary> /// Initializes a new instance of the <see cref="SyntaxError"/> class. /// </summary> /// <param name="message">The syntax error message to log.</param> /// <param name="sourcePosition">The source position of the node in the program.</param> public SyntaxError(string message, SourcePosition sourcePosition) : base(sourcePosition) { Message = message; }