Ejemplo n.º 1
0
 public IfElseStatementNode(ExpressionNode condition, StatementNode ifTrue, StatementNode ifFalse, SourceSpan span)
     : base(span)
 {
     this.condition = condition;
     this.ifTrue = ifTrue;
     this.ifFalse = ifFalse;
 }
Ejemplo n.º 2
0
 public AssignExpressionNode(AssignOperations operation, WritableNode left, ExpressionNode value, SourceSpan sourceSpan)
     : base(sourceSpan)
 {
     this.operation = operation;
     this.left = left;
     this.value = value;
 }
Ejemplo n.º 3
0
 public BinaryExpressionNode(BinaryOperations op, ExpressionNode left, ExpressionNode right, SourceSpan sourceSpan)
     : base(sourceSpan)
 {
     this.op = op;
     this.left = left;
     this.right = right;
 }
Ejemplo n.º 4
0
 public VariableDeclarationNode(string name, ExpressionNode initialization, SourceSpan sourceSpan)
     : base(sourceSpan)
 {
     // TODO: Complete member initialization
     this.name = name;
     this.initialization = initialization;
 }
 public FunctionCallExpressionNode(ExpressionNode function, ArgumentNode[] arguments,
     SourceSpan sourceSpan)
     : base(sourceSpan)
 {
     this.function = function;
     // sort so unnamed arguments comes first.
     this.arguments = arguments.Where(a => a.Name == null).Concat(arguments.Where(a => a.Name != null)).ToArray();
 }
Ejemplo n.º 6
0
 public ForStatementNode(LexicalScope scope, StatementNode initializer, ExpressionNode condition,
     ExpressionNode incrementer, StatementNode body, SourceSpan span)
     : base(span)
 {
     this.scope = scope;
     this.initializer = initializer;
     this.condition = condition;
     this.incrementer = incrementer;
     this.body = body;
 }
Ejemplo n.º 7
0
        public FlowControlStatementNode(FlowControlOperations operation, ExpressionNode operand, SourceSpan sourceSpan)
            : base(sourceSpan)
        {
            switch (operation)
            {
                case FlowControlOperations.Return:
                    break;

                case FlowControlOperations.Break:
                case FlowControlOperations.Continue:
                    Assert.IsTrue(() => operand == null);
                    break;

                default:
                    throw Assert.Unreachable;
            }

            this.operation = operation;
            this.operand = operand;
        }
Ejemplo n.º 8
0
 public ExpressionStatementNode(ExpressionNode expression, SourceSpan sourceSpan)
     : base(sourceSpan)
 {
     this.expression = expression;
 }
Ejemplo n.º 9
0
 public ParameterNode(string name, ExpressionNode defaultValue, SourceSpan sourceSpan)
     : base(sourceSpan)
 {
     this.name = name;
     this.defaultValue = defaultValue;
 }
Ejemplo n.º 10
0
 public UnaryExpressionNode(UnaryOperations operation, ExpressionNode value, SourceSpan sourceSpan)
     : base(sourceSpan)
 {
     this.operation = operation;
     this.value = value;
 }
Ejemplo n.º 11
0
 public IfElseStatementNode(ExpressionNode condition, StatementNode ifTrue, SourceSpan span)
     : this(condition, ifTrue, null, span)
 { }
Ejemplo n.º 12
0
 public ArgumentNode(ExpressionNode value, string name, SourceSpan sourceSpan)
     : base(sourceSpan)
 {
     this.name = name;
     this.value = value;
 }