コード例 #1
0
ファイル: ASTIfThen.cs プロジェクト: goric/cflat
        public ASTIfThen(ASTExpression condition, ASTStatement then)
        {
            Condition = condition;

            //I think it's most appropriate to record the presence of the implied block around 1 line statements here, rather than in the grammar.
            Then          = then.WrapInBlock();
            Then.IsBranch = true;
        }
コード例 #2
0
ファイル: ASTBlock.cs プロジェクト: goric/cflat
 public ASTBlock(ASTStatement body)
 {
     Body = body;
 }
コード例 #3
0
 public ASTStatementList(ASTStatement statement, ASTStatementList tail)
 {
     IsEmpty   = false;
     Statement = statement;
     Tail      = tail;
 }
コード例 #4
0
ファイル: ASTForIn.cs プロジェクト: goric/cflat
 public ASTForIn(ASTIdentifier variable, ASTExpression lower, ASTExpression upper, ASTStatement body)
 {
     TempVariable = variable;
     Lower        = lower;
     Upper        = upper;
     Body         = body.WrapInBlock();
 }
コード例 #5
0
 public ASTWhile(ASTExpression condition, ASTStatement body)
 {
     Condition = condition;
     Body      = body.WrapInBlock();
 }
コード例 #6
0
 public ASTFor(ASTDeclarationLocal init, ASTExpression conditional, ASTExpression loop, ASTStatement body)
 {
     InitialExpr = init;
     Conditional = conditional;
     LoopExpr    = loop;
     Body        = body.WrapInBlock();
 }
コード例 #7
0
ファイル: ASTIfThenElse.cs プロジェクト: goric/cflat
 public ASTIfThenElse(ASTExpression condition, ASTStatement then, ASTStatement elseStatement)
     : base(condition, then)
 {
     Else          = elseStatement.WrapInBlock();
     Else.IsBranch = true;
 }
コード例 #8
0
 public virtual void VisitStatement(ASTStatement n)
 {
 }