class Noise::Lang::Parser

Defined in:

lang/parser.cr

Constant Summary

STOPWORDS = ['+', '-', '*', '/', '[', ']', '(', ')']
WHITESPACE = ['\n', '\t', '\r', ' ']

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(io) #

[View source]

Class Method Detail

def self.lex(io) : Array(String) #

Naive tokenizer


[View source]

Instance Method Detail

def expression : AST::Expression #

Parse an expression Naive recursive descent state machine parser: It first extract all operators and operands in order Then reduce them following operator priorities.


[View source]
def next_token : String | Nil #

[View source]
def parameter(name) : AST::Parameter #

[View source]
def parameter_dimension_alias(dimension : String | Nil) : UInt32 | Nil #

[View source]