private PqlPatternNode Pattern() { PqlToken id = currentToken; PqlSynonym synonym = new PqlSynonym(id); Eat(PqlTokenType.IDENT); Eat(PqlTokenType.LPAREN); PqlArgument varRef = Ref(); Eat(PqlTokenType.COMMA); PqlExpr expr = null; if (currentToken.Type == PqlTokenType.STRING) { expr = Expr(true); } else if (currentToken.Type == PqlTokenType.FLOOR) { Eat(PqlTokenType.FLOOR); if (currentToken.Type == PqlTokenType.STRING) { expr = Expr(false); Eat(PqlTokenType.FLOOR); } else if (currentToken.Type == PqlTokenType.COMMA) { Eat(PqlTokenType.COMMA); Eat(PqlTokenType.FLOOR); } } Eat(PqlTokenType.RPAREN); return(new PqlPatternNode(synonym, varRef, expr)); }
private PqlDeclaration Declaration(PqlToken declarationType) { PqlToken id = currentToken; PqlSynonym synonym = new PqlSynonym(id); Eat(PqlTokenType.IDENT); if (currentToken.Type == PqlTokenType.COMMA) { Eat(PqlTokenType.COMMA); } return(new PqlDeclaration(declarationType, synonym)); }