class Bantam::BantamParser

Overview

Extends the generic Parser class with support for parsing the actual Bantam grammar.

Included Modules

Defined in:

bantam/bantam_parser.cr

Constructors

Instance Method Summary

Instance methods inherited from module Pratt::TokenType

punctuator(token : Type) : Char | Nil punctuator

Instance methods inherited from class Pratt::Parser

consume(expected : TokenType::Type) : Token
consume : 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

def self.new(lexer : Iterator(Pratt::Token)) #

[View source]

Instance Method Detail

def infix_left(token : Type, precedence : Pratt::Precedence) #

Registers a left-associative binary operator parselet for the given token and precedence.


[View source]
def infix_right(token : Type, precedence : Pratt::Precedence) #

Registers a right-associative binary operator parselet for the given token and precedence.


[View source]
def postfix(token : Type, precedence : Pratt::Precedence) #

Registers a postfix unary operator parselet for the given token and precedence.


[View source]
def prefix(token : Type, precedence : Pratt::Precedence) #

Registers a prefix unary operator parselet for the given token and precedence.


[View source]