class Bantam::BantamParser
- Bantam::BantamParser
- Pratt::Parser
- Reference
- Object
Overview
Extends the generic Parser class with support for parsing the actual Bantam grammar.
Included Modules
Defined in:
bantam/bantam_parser.crConstructors
Instance Method Summary
-
#infix_left(token : Type, precedence : Pratt::Precedence)
Registers a left-associative binary operator parselet for the given token and precedence.
-
#infix_right(token : Type, precedence : Pratt::Precedence)
Registers a right-associative binary operator parselet for the given token and precedence.
-
#postfix(token : Type, precedence : Pratt::Precedence)
Registers a postfix unary operator parselet for the given token and precedence.
-
#prefix(token : Type, precedence : Pratt::Precedence)
Registers a prefix unary operator parselet for the given token and precedence.
Instance methods inherited from module Pratt::TokenType
punctuator(token : Type) : Char | Nil
punctuator
Instance methods inherited from class Pratt::Parser
consume(expected : TokenType::Type) : Tokenconsume : Token consume, get_precedence get_precedence, look_ahead(distance) : Token look_ahead, match(expected : TokenType::Type) : Bool match, parse_expression(precedence : Precedence) : Expression
parse_expression : Expression parse_expression, register(token : TokenType::Type, parselet : PrefixParselet)
register(token : TokenType::Type, parselet : InfixParselet) register
Constructor methods inherited from class Pratt::Parser
new(m_tokens : Iterator(Pratt::Token))
new
Constructor Detail
Instance Method Detail
Registers a left-associative binary operator parselet for the given token and precedence.
Registers a right-associative binary operator parselet for the given token and precedence.
Registers a postfix unary operator parselet for the given token and precedence.
Registers a prefix unary operator parselet for the given token and precedence.