Method: AND#initialize
- Defined in:
- lib/antlr4/atn/SemanticContext.rb
#initialize(a, b) ⇒ AND
Returns a new instance of AND.
174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 |
# File 'lib/antlr4/atn/SemanticContext.rb', line 174 def initialize(a, b) operands = Set.new() if a.kind_of? AND then a.opnds.each {|o| operands.add(o) } else operands.add(a) end if b.kind_of? AND then b.opnds.each {|o| operands.add(o) } else operands.add(b) end precedencePredicates = filterPrecedencePredicates(operands) if precedencePredicates.length>0 then # interested in the transition with the lowest precedence reduced = precedencePredicates.min operands.add(reduced) end @opnds = operands.to_a end |