Example usage for org.antlr.v4.runtime.tree TerminalNodeImpl getPayload

List of usage examples for org.antlr.v4.runtime.tree TerminalNodeImpl getPayload

Introduction

In this page you can find the example usage for org.antlr.v4.runtime.tree TerminalNodeImpl getPayload.

Prototype

@Override
    public Token getPayload() 

Source Link

Usage

From source file:nl.han.ica.ap.purify.module.java.removeparameter.RemoveParameterSolver.java

License:Open Source License

/**
 * Remove separator (,)./*from  w w w.ja  va  2s.  c  om*/
 * 
 * @param file Source file of the parse tree.
 * @param context Parameter with ,
 */
private void removeSeparator(SourceFile file, FormalParameterDeclsRestContext context) {
    for (int i = context.getChildCount() - 1; i >= 0; i--) {
        if (context.getChild(i) instanceof TerminalNodeImpl && context.getChild(i).getText().equals(",")) {
            TerminalNodeImpl node = (TerminalNodeImpl) context.getChild(i);

            file.getRewriter().delete(node.getPayload());
        }
    }
}