public void Register(IGrammarBuilder <INode> grammar) { grammar.Choice("range", grammar.TerminalValue("*"), grammar.TerminalValue("+"), grammar.TerminalValue("?"), grammar.Ref("minmax") ).ReduceWith(Reduce); }
public void Register(IGrammarBuilder <INode> grammar) { grammar.Sequence("terminalType", grammar.TerminalValue("T"), grammar.TerminalValue("<"), grammar.Terminal(TokenType.Identifier).As("type"), grammar.TerminalValue(">") ).ReduceWith(Reduce); }
public void Register(IGrammarBuilder <INode> grammar) { grammar.Sequence("minmax", grammar.TerminalValue("{"), grammar.Terminal(TokenType.Number).As("min"), grammar.Optional(null, grammar.TerminalValue(",")).As("sep"), grammar.Optional(null, grammar.Terminal(TokenType.Number)).As("max"), grammar.TerminalValue("}") ).ReduceWith(Reduce); }
public void Register(IGrammarBuilder <INode> grammar) { grammar.Choice("terminalLiteral", grammar.Terminal(TokenType.Literal), grammar.Sequence(null, grammar.TerminalValue("T"), grammar.TerminalValue("<"), grammar.Terminal(TokenType.Literal).Lift(), grammar.TerminalValue(">") ) ).ReduceWith(Reduce); }
public void Register(IGrammarBuilder <INode> grammar) { grammar.Sequence("atomExpression", grammar.Optional(null, grammar.Choice(null, grammar.TerminalValue("&"), grammar.TerminalValue("!") ) ).As("prefix"), grammar.Ref("atom"), grammar.Optional(null, grammar.Ref("range")).As("suffix") ).ReduceWith(Reduce); }
public void Register(IGrammarBuilder <INode> grammar) { grammar.Sequence("namedAtom", grammar.Ref("atomExpression").As("atom"), grammar.Optional(null, grammar.Choice(null, grammar.TerminalValue("#!"), grammar.Sequence(null, grammar.TerminalValue("#"), grammar.Terminal(TokenType.Identifier) )) ).As("name") ).ReduceWith(Reduce); }
public void Register(IGrammarBuilder <INode> grammar) { grammar.Choice("atom", grammar.Ref("ruleRef"), grammar.Ref("terminal"), grammar.Sequence(null, grammar.TerminalValue("("), grammar.Ref("choice").Lift(), grammar.TerminalValue(")")) ); }
public void Register(IGrammarBuilder <INode> grammar) { grammar.Sequence("definition", grammar.Terminal(TokenType.Identifier).As("name"), grammar.TerminalValue(":="), grammar.Ref("choice").As("rule") ).ReduceWith(Reduce); }
public void Register(IGrammarBuilder <INode> grammar) { grammar.Sequence("choice", grammar.Ref("sequence"), grammar.ZeroOrMore(null, grammar.Sequence(null, grammar.TerminalValue("|"), grammar.Ref("sequence").Lift() )) ).ReduceWith(Reduce); }
public void Register(IGrammarBuilder <INode> grammar) { grammar.TerminalValue(".", "terminalAny") .ReduceWith(Reduce); }