Class ControllingCExpressionVisitor
java.lang.Object
org.antlr.v4.runtime.tree.AbstractParseTreeVisitor<StringBuilder>
org.variantsync.diffdetective.feature.cpp.ControllingCExpressionVisitor
- All Implemented Interfaces:
org.antlr.v4.runtime.tree.ParseTreeVisitor<StringBuilder>
,CExpressionVisitor<StringBuilder>
public class ControllingCExpressionVisitor
extends org.antlr.v4.runtime.tree.AbstractParseTreeVisitor<StringBuilder>
implements CExpressionVisitor<StringBuilder>
Visitor that controls how formulas given as an ANTLR parse tree are abstracted.
To this end, the visitor traverses the parse tree, searching for subtrees that should be abstracted.
If such a subtree is found, the visitor calls an
AbstractingCExpressionVisitor
to abstract the entire subtree.
Only those parts of a formula are abstracted that require abstraction, leaving ancestors in the tree unchanged.-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionVisit a parse tree produced byCExpressionParser.additiveExpression()
.Visit a parse tree produced byCExpressionParser.andExpression()
.Visit a parse tree produced byCExpressionParser.argumentExpressionList()
.Visit a parse tree produced byCExpressionParser.assignmentExpression()
.Visit a parse tree produced byCExpressionParser.assignmentOperator()
.Visit a parse tree produced byCExpressionParser.conditionalExpression()
.Visit a parse tree produced byCExpressionParser.equalityExpression()
.Visit a parse tree produced byCExpressionParser.exclusiveOrExpression()
.Visit a parse tree produced byCExpressionParser.expression()
.Visit a parse tree produced byCExpressionParser.inclusiveOrExpression()
.Visit a parse tree produced byCExpressionParser.logicalAndExpression()
.private StringBuilder
visitLogicalExpression
(org.antlr.v4.runtime.ParserRuleContext expressionContext, Function<org.antlr.v4.runtime.tree.ParseTree, Boolean> instanceCheck) Visit a parse tree produced byCExpressionParser.logicalOperand()
.Visit a parse tree produced byCExpressionParser.logicalOrExpression()
.Visit a parse tree produced byCExpressionParser.macroExpression()
.Visit a parse tree produced byCExpressionParser.multiplicativeExpression()
.Visit a parse tree produced byCExpressionParser.namespaceExpression()
.Visit a parse tree produced byCExpressionParser.primaryExpression()
.Visit a parse tree produced byCExpressionParser.relationalExpression()
.Visit a parse tree produced byCExpressionParser.shiftExpression()
.Visit a parse tree produced byCExpressionParser.specialOperator()
.Visit a parse tree produced byCExpressionParser.specialOperatorArgument()
.Visit a parse tree produced byCExpressionParser.unaryOperator()
.Methods inherited from class org.antlr.v4.runtime.tree.AbstractParseTreeVisitor
aggregateResult, defaultResult, shouldVisitNextChild, visit, visitChildren, visitErrorNode, visitTerminal
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.antlr.v4.runtime.tree.ParseTreeVisitor
visit, visitChildren, visitErrorNode, visitTerminal
-
Field Details
-
abstractingVisitor
-
-
Constructor Details
-
ControllingCExpressionVisitor
public ControllingCExpressionVisitor()
-
-
Method Details
-
visitConditionalExpression
Description copied from interface:CExpressionVisitor
Visit a parse tree produced byCExpressionParser.conditionalExpression()
.- Specified by:
visitConditionalExpression
in interfaceCExpressionVisitor<StringBuilder>
- Parameters:
ctx
- the parse tree- Returns:
- the visitor result
-
visitPrimaryExpression
Description copied from interface:CExpressionVisitor
Visit a parse tree produced byCExpressionParser.primaryExpression()
.- Specified by:
visitPrimaryExpression
in interfaceCExpressionVisitor<StringBuilder>
- Parameters:
ctx
- the parse tree- Returns:
- the visitor result
-
visitUnaryOperator
Description copied from interface:CExpressionVisitor
Visit a parse tree produced byCExpressionParser.unaryOperator()
.- Specified by:
visitUnaryOperator
in interfaceCExpressionVisitor<StringBuilder>
- Parameters:
ctx
- the parse tree- Returns:
- the visitor result
-
visitNamespaceExpression
Description copied from interface:CExpressionVisitor
Visit a parse tree produced byCExpressionParser.namespaceExpression()
.- Specified by:
visitNamespaceExpression
in interfaceCExpressionVisitor<StringBuilder>
- Parameters:
ctx
- the parse tree- Returns:
- the visitor result
-
visitMultiplicativeExpression
public StringBuilder visitMultiplicativeExpression(CExpressionParser.MultiplicativeExpressionContext ctx) Description copied from interface:CExpressionVisitor
Visit a parse tree produced byCExpressionParser.multiplicativeExpression()
.- Specified by:
visitMultiplicativeExpression
in interfaceCExpressionVisitor<StringBuilder>
- Parameters:
ctx
- the parse tree- Returns:
- the visitor result
-
visitAdditiveExpression
Description copied from interface:CExpressionVisitor
Visit a parse tree produced byCExpressionParser.additiveExpression()
.- Specified by:
visitAdditiveExpression
in interfaceCExpressionVisitor<StringBuilder>
- Parameters:
ctx
- the parse tree- Returns:
- the visitor result
-
visitShiftExpression
Description copied from interface:CExpressionVisitor
Visit a parse tree produced byCExpressionParser.shiftExpression()
.- Specified by:
visitShiftExpression
in interfaceCExpressionVisitor<StringBuilder>
- Parameters:
ctx
- the parse tree- Returns:
- the visitor result
-
visitRelationalExpression
Description copied from interface:CExpressionVisitor
Visit a parse tree produced byCExpressionParser.relationalExpression()
.- Specified by:
visitRelationalExpression
in interfaceCExpressionVisitor<StringBuilder>
- Parameters:
ctx
- the parse tree- Returns:
- the visitor result
-
visitEqualityExpression
Description copied from interface:CExpressionVisitor
Visit a parse tree produced byCExpressionParser.equalityExpression()
.- Specified by:
visitEqualityExpression
in interfaceCExpressionVisitor<StringBuilder>
- Parameters:
ctx
- the parse tree- Returns:
- the visitor result
-
visitSpecialOperator
Description copied from interface:CExpressionVisitor
Visit a parse tree produced byCExpressionParser.specialOperator()
.- Specified by:
visitSpecialOperator
in interfaceCExpressionVisitor<StringBuilder>
- Parameters:
ctx
- the parse tree- Returns:
- the visitor result
-
visitSpecialOperatorArgument
public StringBuilder visitSpecialOperatorArgument(CExpressionParser.SpecialOperatorArgumentContext ctx) Description copied from interface:CExpressionVisitor
Visit a parse tree produced byCExpressionParser.specialOperatorArgument()
.- Specified by:
visitSpecialOperatorArgument
in interfaceCExpressionVisitor<StringBuilder>
- Parameters:
ctx
- the parse tree- Returns:
- the visitor result
-
visitMacroExpression
Description copied from interface:CExpressionVisitor
Visit a parse tree produced byCExpressionParser.macroExpression()
.- Specified by:
visitMacroExpression
in interfaceCExpressionVisitor<StringBuilder>
- Parameters:
ctx
- the parse tree- Returns:
- the visitor result
-
visitArgumentExpressionList
public StringBuilder visitArgumentExpressionList(CExpressionParser.ArgumentExpressionListContext ctx) Description copied from interface:CExpressionVisitor
Visit a parse tree produced byCExpressionParser.argumentExpressionList()
.- Specified by:
visitArgumentExpressionList
in interfaceCExpressionVisitor<StringBuilder>
- Parameters:
ctx
- the parse tree- Returns:
- the visitor result
-
visitAssignmentExpression
Description copied from interface:CExpressionVisitor
Visit a parse tree produced byCExpressionParser.assignmentExpression()
.- Specified by:
visitAssignmentExpression
in interfaceCExpressionVisitor<StringBuilder>
- Parameters:
ctx
- the parse tree- Returns:
- the visitor result
-
visitAssignmentOperator
Description copied from interface:CExpressionVisitor
Visit a parse tree produced byCExpressionParser.assignmentOperator()
.- Specified by:
visitAssignmentOperator
in interfaceCExpressionVisitor<StringBuilder>
- Parameters:
ctx
- the parse tree- Returns:
- the visitor result
-
visitExpression
Description copied from interface:CExpressionVisitor
Visit a parse tree produced byCExpressionParser.expression()
.- Specified by:
visitExpression
in interfaceCExpressionVisitor<StringBuilder>
- Parameters:
ctx
- the parse tree- Returns:
- the visitor result
-
visitAndExpression
Description copied from interface:CExpressionVisitor
Visit a parse tree produced byCExpressionParser.andExpression()
.- Specified by:
visitAndExpression
in interfaceCExpressionVisitor<StringBuilder>
- Parameters:
ctx
- the parse tree- Returns:
- the visitor result
-
visitExclusiveOrExpression
Description copied from interface:CExpressionVisitor
Visit a parse tree produced byCExpressionParser.exclusiveOrExpression()
.- Specified by:
visitExclusiveOrExpression
in interfaceCExpressionVisitor<StringBuilder>
- Parameters:
ctx
- the parse tree- Returns:
- the visitor result
-
visitInclusiveOrExpression
Description copied from interface:CExpressionVisitor
Visit a parse tree produced byCExpressionParser.inclusiveOrExpression()
.- Specified by:
visitInclusiveOrExpression
in interfaceCExpressionVisitor<StringBuilder>
- Parameters:
ctx
- the parse tree- Returns:
- the visitor result
-
visitLogicalAndExpression
Description copied from interface:CExpressionVisitor
Visit a parse tree produced byCExpressionParser.logicalAndExpression()
.- Specified by:
visitLogicalAndExpression
in interfaceCExpressionVisitor<StringBuilder>
- Parameters:
ctx
- the parse tree- Returns:
- the visitor result
-
visitLogicalOrExpression
Description copied from interface:CExpressionVisitor
Visit a parse tree produced byCExpressionParser.logicalOrExpression()
.- Specified by:
visitLogicalOrExpression
in interfaceCExpressionVisitor<StringBuilder>
- Parameters:
ctx
- the parse tree- Returns:
- the visitor result
-
visitLogicalOperand
Description copied from interface:CExpressionVisitor
Visit a parse tree produced byCExpressionParser.logicalOperand()
.- Specified by:
visitLogicalOperand
in interfaceCExpressionVisitor<StringBuilder>
- Parameters:
ctx
- the parse tree- Returns:
- the visitor result
-
visitLogicalExpression
private StringBuilder visitLogicalExpression(org.antlr.v4.runtime.ParserRuleContext expressionContext, Function<org.antlr.v4.runtime.tree.ParseTree, Boolean> instanceCheck)
-