Parent

Racc::Sym

Stands terminal and nonterminal symbols.

Attributes

ident[R]
value[R]
serialized[W]
precedence[RW]
assoc[RW]
heads[R]

cache

locate[R]
expand[R]

Public Class Methods

new(value, dummyp) click to toggle source
      # File lib/racc/grammar.rb, line 971
 971:     def initialize(value, dummyp)
 972:       @ident = nil
 973:       @value = value
 974:       @dummyp = dummyp
 975: 
 976:       @term  = nil
 977:       @nterm = nil
 978:       @should_terminal = false
 979:       @precedence = nil
 980:       case value
 981:       when Symbol
 982:         @to_s = value.to_s
 983:         @serialized = value.inspect
 984:         @string = false
 985:       when String
 986:         @to_s = value.inspect
 987:         @serialized = value.dump
 988:         @string = true
 989:       when false
 990:         @to_s = '$end'
 991:         @serialized = 'false'
 992:         @string = false
 993:       when ErrorSymbolValue
 994:         @to_s = 'error'
 995:         @serialized = 'Object.new'
 996:         @string = false
 997:       else
 998:         raise ArgumentError, "unknown symbol value: #{value.class}"
 999:       end
1000: 
1001:       @heads    = []
1002:       @locate   = []
1003:       @snull    = nil
1004:       @null     = nil
1005:       @expand   = nil
1006:       @useless  = nil
1007:     end
once_writer(nm) click to toggle source
      # File lib/racc/grammar.rb, line 1010
1010:       def once_writer(nm)
1011:         nm = nm.id2name
1012:         module_eval(          def #{nm}=(v)            raise 'racc: fatal: @#{nm} != nil' unless @#{nm}.nil?            @#{nm} = v          end)
1013:       end

Public Instance Methods

dummy?() click to toggle source
      # File lib/racc/grammar.rb, line 1028
1028:     def dummy?
1029:       @dummyp
1030:     end
inspect() click to toggle source
Alias for: to_s
nonterminal?() click to toggle source
      # File lib/racc/grammar.rb, line 1036
1036:     def nonterminal?
1037:       @nterm
1038:     end
null=(n) click to toggle source
      # File lib/racc/grammar.rb, line 1098
1098:     def null=(n)
1099:       @null = n
1100:     end
nullable?() click to toggle source
      # File lib/racc/grammar.rb, line 1094
1094:     def nullable?
1095:       @null
1096:     end
rule() click to toggle source
      # File lib/racc/grammar.rb, line 1077
1077:     def rule
1078:       Rule.new(nil, [self], UserAction.empty)
1079:     end
self_null?() click to toggle source
      # File lib/racc/grammar.rb, line 1088
1088:     def self_null?
1089:       @snull
1090:     end
serialize() click to toggle source
      # File lib/racc/grammar.rb, line 1058
1058:     def serialize
1059:       @serialized
1060:     end
should_terminal() click to toggle source
      # File lib/racc/grammar.rb, line 1046
1046:     def should_terminal
1047:       @should_terminal = true
1048:     end
should_terminal?() click to toggle source
      # File lib/racc/grammar.rb, line 1050
1050:     def should_terminal?
1051:       @should_terminal
1052:     end
string_symbol?() click to toggle source
      # File lib/racc/grammar.rb, line 1054
1054:     def string_symbol?
1055:       @string
1056:     end
term=(t) click to toggle source
      # File lib/racc/grammar.rb, line 1040
1040:     def term=(t)
1041:       raise 'racc: fatal: term= called twice' unless @term.nil?
1042:       @term = t
1043:       @nterm = !t
1044:     end
terminal?() click to toggle source
      # File lib/racc/grammar.rb, line 1032
1032:     def terminal?
1033:       @term
1034:     end
to_s() click to toggle source
      # File lib/racc/grammar.rb, line 1067
1067:     def to_s
1068:       @to_s.dup
1069:     end
Also aliased as: inspect
useless=(f) click to toggle source
      # File lib/racc/grammar.rb, line 1109
1109:     def useless=(f)
1110:       @useless = f
1111:     end
useless?() click to toggle source
      # File lib/racc/grammar.rb, line 1105
1105:     def useless?
1106:       @useless
1107:     end
|(x) click to toggle source
      # File lib/racc/grammar.rb, line 1073
1073:     def |(x)
1074:       rule() | x.rule
1075:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.