class Myst::Parser

Defined in:

myst/syntax/parser.cr

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from class Myst::Lexer

advance_token advance_token, check_for_keyword check_for_keyword, col : Int32 col, col=(col : Int32) col=, consume_comment consume_comment, consume_constant consume_constant, consume_identifier consume_identifier, consume_numeric consume_numeric, consume_string consume_string, consume_symbol_or_colon consume_symbol_or_colon, consume_whitespace consume_whitespace, current_char : Char current_char, current_location current_location, current_token : Token current_token, current_token=(current_token : Token) current_token=, finalize_token finalize_token, finished? : Bool finished?, last_char : Char last_char, last_char=(last_char : Char) last_char=, lex_all lex_all, peek_char : Char peek_char, read_char : Char read_char, read_token : Token read_token, reader : Reader reader, reader=(reader : Reader) reader=, row : Int32 row, row=(row : Int32) row=, source_file : String source_file, source_file=(source_file : String) source_file=, tokens : Array(Token) tokens, tokens=(tokens : Array(Token)) tokens=

Constructor methods inherited from class Myst::Lexer

new(source : IO, source_file : String) new

Constructor Detail

def self.new(source : IO, source_file : String) #

[View source]

Class Method Detail

def self.for_file(source_file) #

[View source]

Instance Method Detail

def accept(*types : Token::Type) #

[View source]
def accept_delimiter #

[View source]
def expect(*types : Token::Type) #

[View source]
def expect_delimiter #

[View source]
def expect_delimiter_or_eof #

[View source]
def is_local_var?(name : String) #

[View source]
def parse #

Parse the entirety of the given source. Currently, this assumes valid input and will only end when an EOF is encountered.


[View source]
def parse_additive(left = nil) #

Arithmetic is left-associative. 1 - 1 - 1 must be parsed as ((1 - 1) - 1) to follow mathematic precedence and give the right result of -2, rather than (1 - (1 - 1)), which would yield 0.


[View source]
def parse_assign #

[View source]
def parse_code_block(*terminators) #

A code block is a set of expressions contained by some other expression. For example, the body of a method definition.


[View source]
def parse_comparative #

[View source]
def parse_conditional #

[View source]
def parse_def #

[View source]
def parse_equality #

[View source]
def parse_exception_handler #

[View source]
def parse_expression #

[View source]
def parse_flow_control #

[View source]
def parse_include #

[View source]
def parse_instantiation #

[View source]
def parse_list_literal #

[View source]
def parse_literal #

[View source]
def parse_logical_and #

[View source]
def parse_logical_or #

[View source]
def parse_loop #

[View source]
def parse_map_key #

[View source]
def parse_map_literal #

[View source]
def parse_module_def #

[View source]
def parse_multiplicative(left = nil) #

[View source]
def parse_optional_block #

[View source]
def parse_param(allow_splat = true) #

[View source]
def parse_postfix(receiver = nil) #

[View source]
def parse_primary #

[View source]
def parse_require #

[View source]
def parse_type_def #

[View source]
def parse_unary #

[View source]
def parse_value_interpolation #

[View source]
def parse_var_or_call(receiver = nil) #

[View source]
def pop_var_scope #

[View source]
def push_local_var(name : String) #

[View source]
def push_var_scope(scope = Set(String).new) #

[View source]
def skip_space #

Skip through whitespace tokens, but only if the current token is already a whitespace token.


[View source]
def skip_space_and_newlines #

[View source]