Class: ParseTreeVisitor

Inherits:
Object show all
Defined in:
lib/antlr4/tree/Tree.rb

Overview

This interface defines the basic notion of a parse tree visitor. Generated visitors implement this interface and the XVisitor interface for grammar X.

Instance Method Summary collapse

Instance Method Details

#visit(tree) ⇒ Object

Visit a parse tree, and return a user-defined result of the operation.

Parameters:

  • tree

    The ParseTree to visit.

Returns:

  • The result of visiting the parse tree.



32
33
# File 'lib/antlr4/tree/Tree.rb', line 32

def visit(tree) # tree:ParseTree 
end

#visitChildren(node) ⇒ Object

Visit the children of a node, and return a user-defined result of the operation.

Parameters:

  • node

    The RuleNode whose children should be visited.

Returns:

  • The result of visiting the children of the node.



38
39
# File 'lib/antlr4/tree/Tree.rb', line 38

def visitChildren(node) # node:RuleNode 
end

#visitErrorNode(node) ⇒ Object

Returns The result of visiting the node.

Parameters:

  • node

    The ErrorNode to visit.

Returns:

  • The result of visiting the node.



51
52
# File 'lib/antlr4/tree/Tree.rb', line 51

def visitErrorNode(node) # node:ErrorNode 
end

#visitTerminal(node) ⇒ Object

Visit a terminal node, and return a user-defined result of the operation.

Parameters:

  • node

    The TerminalNode to visit.

Returns:

  • The result of visiting the node.



45
46
# File 'lib/antlr4/tree/Tree.rb', line 45

def visitTerminal(node) # node:TerminalNode 
end