Class: Norikra::Query::ASTPatternNode
- Defined in:
- lib/norikra/query/ast.rb
Instance Attribute Summary
Attributes inherited from ASTNode
Instance Method Summary collapse
- #alias ⇒ Object
- #fields(default_target = nil, known_targets_aliases = []) ⇒ Object
-
#nodetype?(*sym) ⇒ Boolean
[“patternFilterExpression”, “b”, “=”, [“classIdentifier”, [“escapableStr”, “EventA”]], “(”, [“expressionList”, [“expression”, EXPRESSION…], “,”, [“expression”, EXPRESSION…]], “)”].
- #target ⇒ Object
Methods inherited from ASTNode
#chain, #child, #find, #has_a?, #initialize, #listup, #to_a
Constructor Details
This class inherits a constructor from Norikra::Query::ASTNode
Instance Method Details
#alias ⇒ Object
1513 1514 1515 |
# File 'lib/norikra/query/ast.rb', line 1513 def alias @children[0].name end |
#fields(default_target = nil, known_targets_aliases = []) ⇒ Object
1517 1518 1519 1520 |
# File 'lib/norikra/query/ast.rb', line 1517 def fields(default_target=nil, known_targets_aliases=[]) this_target = self.target self.listup(:prop).map{|p| p.fields(this_target, known_targets_aliases) }.reduce(&:+) || [] end |
#nodetype?(*sym) ⇒ Boolean
[“patternFilterExpression”, “b”, “=”, [“classIdentifier”, [“escapableStr”, “EventA”]],
"(",
["expressionList", ["expression", EXPRESSION...], ",", ["expression", EXPRESSION...]],
")"]
1505 1506 1507 |
# File 'lib/norikra/query/ast.rb', line 1505 def nodetype?(*sym) sym.include?(:pattern) end |
#target ⇒ Object
1509 1510 1511 |
# File 'lib/norikra/query/ast.rb', line 1509 def target self.find('classIdentifier').find('escapableStr').child.name end |