public NumberBuilder WithMinusSign() { _numberRule.Sign = new SignRule { Sign = TerminalNodeBuilder.Of(Token.Minus) }; return(this); }
public MainFunctionBuilder() { _mainFunctionRule = new MainFunctionRule { DataType = TerminalNodeBuilder.Of(Token.Int), Main = TerminalNodeBuilder.Of(Token.Main), LeftParenthesis = TerminalNodeBuilder.Of(Token.ParenthesisLeft), RightParenthesis = TerminalNodeBuilder.Of(Token.ParenthesisRight), FunctionBody = new FunctionBodyRule { LeftCurlyBracket = TerminalNodeBuilder.Of(Token.CurlyBracketLeft), RightCurlyBracket = TerminalNodeBuilder.Of(Token.CurlyBracketRight), ReturnStatement = new ReturnStatementRule { Return = TerminalNodeBuilder.Of(Token.Return), Expression = new ExpressionRule { Term = new TermRule { Number = new NumberRule { Number = TerminalNodeBuilder.Of(Token.ConstantNumber, "0") } } }, Semicolon = TerminalNodeBuilder.Of(Token.Semicolon) } } }; }
public TermBuilder AsIdentifier(string identifier) { Build.Identifier = TerminalNodeBuilder.Of(Token.Identifier, identifier); return(this); }
public NumberBuilder(string number) { _numberRule = new NumberRule { Number = TerminalNodeBuilder.Of(Token.ConstantNumber, number) }; }