Example #1
0
 public IfElseStatementNode(ExpressionNode condition, StatementNode ifTrue, StatementNode ifFalse, SourceSpan span)
     : base(span)
 {
     this.condition = condition;
     this.ifTrue = ifTrue;
     this.ifFalse = ifFalse;
 }
 public AssignExpressionNode(AssignOperations operation, WritableNode left, ExpressionNode value, SourceSpan sourceSpan)
     : base(sourceSpan)
 {
     this.operation = operation;
     this.left = left;
     this.value = value;
 }
 public BinaryExpressionNode(BinaryOperations op, ExpressionNode left, ExpressionNode right, SourceSpan sourceSpan)
     : base(sourceSpan)
 {
     this.op = op;
     this.left = left;
     this.right = right;
 }
 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();
 }
Example #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;
 }
        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;
        }
 public ExpressionStatementNode(ExpressionNode expression, SourceSpan sourceSpan)
     : base(sourceSpan)
 {
     this.expression = expression;
 }
Example #9
0
 public ParameterNode(string name, ExpressionNode defaultValue, SourceSpan sourceSpan)
     : base(sourceSpan)
 {
     this.name = name;
     this.defaultValue = defaultValue;
 }
Example #10
0
 public UnaryExpressionNode(UnaryOperations operation, ExpressionNode value, SourceSpan sourceSpan)
     : base(sourceSpan)
 {
     this.operation = operation;
     this.value = value;
 }
Example #11
0
 public IfElseStatementNode(ExpressionNode condition, StatementNode ifTrue, SourceSpan span)
     : this(condition, ifTrue, null, span)
 { }
Example #12
0
 public ArgumentNode(ExpressionNode value, string name, SourceSpan sourceSpan)
     : base(sourceSpan)
 {
     this.name = name;
     this.value = value;
 }