public new static Stmt Match() { Match('['); var saved_env = Top; Parser.current.top = new Env(Top); var stmt = Stmts.Match(); Match(']'); Parser.current.top = saved_env; return(stmt); }
public static Method Match(Class @class) { var function = new Method() { @class = @class }; Match(FUNC); function.name = Look.ToString(); Match(ID); Match('('); if (Check(BASIC) || Check(ID)) { function.return_match = Type.Match(); } else { function.@return = Type.Void; } Match('|'); if (Check(BASIC) || Check(ID)) { [email protected](match_param()); while (Check(',')) { Move(); [email protected](match_param()); } } Match(')'); Match('{'); function.statements = Stmts.Match(); Match('}'); return(function); }