struct CLTK::Lexer::Rule
- CLTK::Lexer::Rule
- Struct
- Value
- Object
Overview
The Rule class is used simply for data encapsulation.
Defined in:
cltk/lexer/rule.crConstructors
Instance Method Summary
-
#action : Regex::MatchData, String, CLTK::Lexer::Environment -> {String | Symbol | Nil, Array(String) | Float64 | Int32 | String | Nil}
@return [Proc] Token producting action to be taken when this rule is matched.
-
#flags : Array(Symbol)
@return [Array
] Flags currently set in this lexing environment. -
#pattern : Regex
@return [Regexp] Regular expression for matching this rule.
Instance methods inherited from class Object
in?(collection : Array | Set)
in?
Constructor Detail
def self.new(pattern : Regex, state : Symbol, flags : Array(Symbol), &action : Proc(Regex::MatchData, String, CLTK::Lexer::Environment, BlockReturn))
#
Instance Method Detail
def action : Regex::MatchData, String, CLTK::Lexer::Environment -> {String | Symbol | Nil, Array(String) | Float64 | Int32 | String | Nil}
#
@return [Proc] Token producting action to be taken when this rule is matched.