class

Sheety::Token

Inherits Reference < Object

Base class for all tokens in the formula parser

Constructors

new(source : String, context : Hash(String, BigFloat | String) | Nil = nil)
Source

Instance methods

ast(tokens : Array(Token), stack : Array(Token), builder : AstBuilder) : Nil

Add this token to the AST - called during parsing

Source
attr
Source
attr=(attr : Hash(String, String | Bool | BigFloat | Int32))
Source
compile

Compile the token to executable code

Source
end_match
Source
end_match=(end_match : Int32)
Source
match(s : String) : Regex::MatchData | Nil

Try to match the token pattern against the input string

Source
name

Get the token name from attributes

Source
process(match : Regex::MatchData) : Nil

Process the match result and populate attributes

Source
source
Source
source=(source : String)
Source
update_input_tokens(*tokens : Token) : Nil

Update input tokens (used by operators and functions)

Source