public Procedure(string name, VariableSequence valArgs, Variable resultArg, StatementSequence statements) { AddChild(valArgs); AddChild(resultArg); AddChild(statements); _name = name; }
private StatementSequence ToStatementSequence(Statement s) { if (s is StatementSequence) { return (StatementSequence)s; } else { StatementSequence seq = new StatementSequence(); seq.AddStatement(s); return seq; } }
public virtual void Visit(StatementSequence node) { }
public While(TypedExpression<bool> exp, StatementSequence statements) { AddChild(exp); AddChild(statements); }
public If(TypedExpression<bool> exp, StatementSequence ifBranch, StatementSequence elseBranch) { AddChild(exp); AddChild(ifBranch); AddChild(elseBranch); }
public Block(VariableDeclarationSequence vars, StatementSequence stmts) { AddChild(vars); AddChild(stmts); }
public WhileProgram(ProcedureSequence procs, StatementSequence stmts) { AddChild(procs); AddChild(stmts); }
void StmtSeq(out StatementSequence statements) { Statement stmt; statements = new StatementSequence(); Stmt(out stmt); statements.AddStatement(stmt); while (la.kind == 11) { Get(); Stmt(out stmt); statements.AddStatement(stmt); } }