コード例 #1
0
 /// <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;
 }
コード例 #2
0
 /// <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)
 {
 }
コード例 #3
0
 /// <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)
 {
 }
コード例 #4
0
 /// <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)
 {
 }
コード例 #5
0
 /// <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)
 {
 }
コード例 #6
0
 /// <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;
 }
コード例 #7
0
 public IdentifiableNode(SourcePosition sourcePosition) : base(sourcePosition)
 {
 }
コード例 #8
0
 /// <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)
 {
 }
コード例 #9
0
 /// <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)
 {
 }
コード例 #10
0
 /// <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)
 {
 }
コード例 #11
0
 /// <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)
 {
 }
コード例 #12
0
 /// <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)
 {
 }
コード例 #13
0
 /// <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)
 {
 }
コード例 #14
0
 /// <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.";
 }
コード例 #15
0
 /// <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)
 {
 }
コード例 #16
0
 public TerminalNode(string text, SourcePosition sourcePosition) : base(sourcePosition)
 {
     Text = text;
 }
コード例 #17
0
 /// <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)
 {
 }
コード例 #18
0
 /// <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>();
 }
コード例 #19
0
 /// <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;
 }
コード例 #20
0
 public BaseTypeNode(SourcePosition sourcePosition) : base(sourcePosition)
 {
 }
コード例 #21
0
 public ExpressionNode(SourcePosition sourcePosition) : base(sourcePosition)
 {
 }
コード例 #22
0
 /// <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;
 }
コード例 #23
0
 /// <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}'.";
 }
コード例 #24
0
 public ControlStructureNode(SourcePosition sourcePosition) : base(sourcePosition)
 {
 }
コード例 #25
0
 /// <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))
 {
 }
コード例 #26
0
 /// <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)
 {
 }
コード例 #27
0
 /// <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)
 {
 }
コード例 #28
0
 /// <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>();
 }
コード例 #29
0
 /// <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)
 {
 }
コード例 #30
0
 /// <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;
 }