class Myst::Parser
- Myst::Parser
- Myst::Lexer
- Reference
- Object
Defined in:
myst/syntax/parser.crConstructors
Class Method Summary
Instance Method Summary
- #accept(*types : Token::Type)
- #accept_delimiter
- #expect(*types : Token::Type)
- #expect_delimiter
- #expect_delimiter_or_eof
- #is_local_var?(name : String)
-
#parse
Parse the entirety of the given source.
-
#parse_additive(left = nil)
Arithmetic is left-associative.
- #parse_assign
-
#parse_code_block(*terminators)
A code block is a set of expressions contained by some other expression.
- #parse_comparative
- #parse_conditional
- #parse_def
- #parse_equality
- #parse_exception_handler
- #parse_expression
- #parse_flow_control
- #parse_include
- #parse_instantiation
- #parse_list_literal
- #parse_literal
- #parse_logical_and
- #parse_logical_or
- #parse_loop
- #parse_map_key
- #parse_map_literal
- #parse_module_def
- #parse_multiplicative(left = nil)
- #parse_optional_block
- #parse_param(allow_splat = true)
- #parse_postfix(receiver = nil)
- #parse_primary
- #parse_require
- #parse_type_def
- #parse_unary
- #parse_value_interpolation
- #parse_var_or_call(receiver = nil)
- #pop_var_scope
- #push_local_var(name : String)
- #push_var_scope(scope = Set(String).new)
-
#skip_space
Skip through whitespace tokens, but only if the current token is already a whitespace token.
- #skip_space_and_newlines
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
Class Method Detail
Instance Method Detail
Parse the entirety of the given source. Currently, this assumes valid input and will only end when an EOF is encountered.
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
.
A code block is a set of expressions contained by some other expression. For example, the body of a method definition.
Skip through whitespace tokens, but only if the current token is already a whitespace token.