class Funk::Parser

Defined in:

funk/syntax/parser.cr

Constant Summary

PRECEDENCES = {TokenType::Equal => Precedences::EQUALS, TokenType::NotEqual => Precedences::EQUALS, TokenType::LessThan => Precedences::LESS_GREATER, TokenType::LessEqual => Precedences::LESS_GREATER, TokenType::GreaterThan => Precedences::LESS_GREATER, TokenType::GreaterEqual => Precedences::LESS_GREATER, TokenType::Plus => Precedences::SUM, TokenType::Minus => Precedences::SUM, TokenType::Divide => Precedences::PRODUCT, TokenType::Multiply => Precedences::PRODUCT, TokenType::LeftParen => Precedences::CALL} of TokenType => Precedences
VALID_INFIX_ASSIGNMENTS = {TokenType::Assignment, TokenType::PlusAssign, TokenType::MinusAssign, TokenType::MultiplyAssign, TokenType::DivideAssign, TokenType::PowerAssign}

Constructors

Instance Method Summary

Constructor Detail

def self.new(lexer : Funk::Lexer, lookahead : Int32 = 3) #

[View source]

Instance Method Detail

def errors : Array(String) #

[View source]
def errors=(errors : Array(String)) #

[View source]
def index : Int32 #

[View source]
def index=(index : Int32) #

[View source]
def infix_parsers : Hash(TokenType, Proc(Ast, Ast)) #

[View source]
def infix_parsers=(infix_parsers : Hash(TokenType, Proc(Ast, Ast))) #

[View source]
def lexer : Lexer #

[View source]
def lexer=(lexer : Lexer) #

[View source]
def lookahead : Int32 #

[View source]
def lookahead=(lookahead : Int32) #

[View source]
def parse! : Parser #

[View source]
def prefix_parsers : Hash(TokenType, Proc(Ast)) #

[View source]
def prefix_parsers=(prefix_parsers : Hash(TokenType, Proc(Ast))) #

[View source]
def program : Program #

[View source]
def program=(program : Program) #

[View source]
def tokens : Array(Token) #

[View source]
def tokens=(tokens : Array(Token)) #

[View source]
def tree : Array(Ast) #

[View source]
def tree=(tree : Array(Ast)) #

[View source]