class Axal::Parser
- Axal::Parser
- Reference
- Object
Defined in:
lang/parser.crConstant Summary
-
BINARY_OPERATORS =
[TokenKind::PLUS, TokenKind::HYPHEN, TokenKind::ASTERISK, TokenKind::FORWARD_SLASH, TokenKind::DOUBLE_EQUALS, TokenKind::NOT_EQUAL, TokenKind::GREATER_THAN, TokenKind::LESS_THAN, TokenKind::GREATER_THAN_OR_EQUAL, TokenKind::LESS_THAN_OR_EQUAL]
-
LOGICAL_OPERATORS =
[TokenKind::OR, TokenKind::AND]
-
LOWEST_PRECEDENCE =
0
-
OPERATOR_PRECEDENCE =
{TokenKind::OR => 1, TokenKind::AND => 2, TokenKind::DOUBLE_EQUALS => 3, TokenKind::NOT_EQUAL => 3, TokenKind::GREATER_THAN => 4, TokenKind::LESS_THAN => 4, TokenKind::GREATER_THAN_OR_EQUAL => 4, TokenKind::LESS_THAN_OR_EQUAL => 4, TokenKind::PLUS => 5, TokenKind::HYPHEN => 5, TokenKind::ASTERISK => 6, TokenKind::FORWARD_SLASH => 6, TokenKind::LEFT_PAREN => 8}
-
PREFIX_PRECEDENCE =
7
-
UNARY_OPERATORS =
[TokenKind::EXCLAMATION, TokenKind::HYPHEN]
Constructors
Instance Method Summary
- #ast : AST::Program
- #build_token(kind : TokenKind, lexeme, location)
- #chain : AST::FunctionChain | Nil
- #check_syntax_compliance(ast_node)
- #consume(offset = 1)
- #consume_if_nxt_is(expected_kind)
- #current
- #current_precedence
- #errors : Array(Exception)
- #lookahead(offset = 1)
- #next_p : Int32
- #nxt
- #nxt_not_terminator?
- #nxt_precedence
- #parse
- #parse_array
- #parse_array_content
- #parse_binary_operator(left)
- #parse_block
- #parse_boolean
- #parse_conditional
- #parse_describe
-
#parse_expr_recursively(precedence = LOWEST_PRECEDENCE)
ameba:disable Metrics/CyclomaticComplexity
- #parse_external_code
- #parse_fget
- #parse_function_call(identifier)
- #parse_function_call_args
- #parse_function_definition
- #parse_function_params
- #parse_grouped_expr
- #parse_identifier
- #parse_it
- #parse_json
- #parse_json_content
- #parse_json_pair
- #parse_module_definition
- #parse_nil
- #parse_number
- #parse_qualified_identifier
- #parse_repetition
- #parse_return
- #parse_string
- #parse_terminator
- #parse_unary_operator
- #parse_var_binding
- #pending_tokens?
- #previous
- #tokens : Array(Token)
- #unexpected_token_error(expected_kind = nil)
- #unrecognized_token_error
Constructor Detail
Instance Method Detail
def parse_expr_recursively(precedence = LOWEST_PRECEDENCE)
#
ameba:disable Metrics/CyclomaticComplexity