Class: Citrus::Alias

Inherits:
Object show all
Includes:
Proxy
Defined in:
lib/citrus.rb

Overview

An Alias is a Proxy for a rule in the same grammar. It is used in rule definitions when a rule calls some other rule by name. The Citrus notation is simply the name of another rule without any other punctuation, e.g.:

name

Instance Attribute Summary

Attributes included from Proxy

#rule_name

Attributes included from Rule

#extension, #grammar, #label, #name

Instance Method Summary collapse

Methods included from Proxy

#elide?, #exec, #extend_match, #initialize, #rule

Methods included from Rule

#==, #===, #default_options, #elide?, #extend_match, for, #inspect, #needs_paren?, #parse, #terminal?, #test, #to_embedded_s, #to_s

Instance Method Details

#to_citrus ⇒ Object

Returns the Citrus notation of this rule as a string.



813
814
815
# File 'lib/citrus.rb', line 813

def to_citrus # :nodoc:
  rule_name.to_s
end