Method: TaskJuggler::TextParser#pattern

Defined in:
lib/taskjuggler/TextParser.rb

#pattern(tokens, func = nil) ⇒ Object

Add a new pattern to the most recently added rule. tokens is an array of strings that specify the syntax elements of the pattern. Each token must start with an character that identifies the type of the token. The following types are supported.

  • ! a reference to another rule

  • $ a variable token as delivered by the scanner

  • _ a literal token.

func is a Proc object that is called whenever the parser has completed the processing of this rule.



155
156
157
# File 'lib/taskjuggler/TextParser.rb', line 155

def pattern(tokens, func = nil)
  @cr.addPattern(TextParser::Pattern.new(tokens, func))
end