当前位置: 首页>>代码示例>>Java>>正文


Java ParseTree.accept方法代码示例

本文整理汇总了Java中org.antlr.v4.runtime.tree.ParseTree.accept方法的典型用法代码示例。如果您正苦于以下问题:Java ParseTree.accept方法的具体用法?Java ParseTree.accept怎么用?Java ParseTree.accept使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.antlr.v4.runtime.tree.ParseTree的用法示例。


在下文中一共展示了ParseTree.accept方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: visitApiFacets

import org.antlr.v4.runtime.tree.ParseTree; //导入方法依赖的package包/类
@Override
public Object visitApiFacets(RAMLParser.ApiFacetsContext ctx) {
    // TODO move creation of security schemes to 1 pass
    final RAMLParser.SecuritySchemesFacetContext securitySchemesFacet = ctx.securitySchemesFacet();
    if (securitySchemesFacet != null) {
        visitSecuritySchemesFacet(securitySchemesFacet);
    }

    for (int i = 0; i < ctx.getChildCount(); i++) {
        final ParseTree child = ctx.getChild(i);
        if (child != securitySchemesFacet) {
            child.accept(this);
        }
    }

    return scope.eObject();
}
 
开发者ID:vrapio,项目名称:rest-modeling-framework,代码行数:18,代码来源:ApiConstructor.java

示例2: visitChildren

import org.antlr.v4.runtime.tree.ParseTree; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public Object visitChildren(final RuleNode node) {

	final int n = node.getChildCount();

	for (int i = 0; i < n; i++) {
		final ParseTree c = node.getChild(i);
		c.accept(this);

	}
	final String textToFind = node.getText();
	if (StringUtils.containsIgnoreCase(textToFind, tempText)
			|| StringUtils.containsIgnoreCase(tempText, textToFind)) {
		nodes.add(new ParsedNode(node));
	}
	return null;

}
 
开发者ID:gretard,项目名称:sonar-tsql-plugin,代码行数:20,代码来源:NodeUsesProvider.java

示例3: visitChildren

import org.antlr.v4.runtime.tree.ParseTree; //导入方法依赖的package包/类
public String visitChildren(RuleNode node, List<Integer> withoutNodes) {
    if(node == null) return "";
    String result = this.defaultResult();
    int n = node.getChildCount();

    for(int i = 0; i < n && this.shouldVisitNextChild(node, result); ++i) {
        if(withoutNodes != null && withoutNodes.contains(i)) continue;
        ParseTree c = node.getChild(i);
        String childResult = c instanceof TerminalNode ? printTerminalNode((TerminalNode) c) : c.accept(this);
        result = this.aggregateResult(result, childResult);
    }

    return result;
}
 
开发者ID:marcelganczak,项目名称:ts-swift-transpiler,代码行数:15,代码来源:Visitor.java

示例4: visitWithoutTerminals

import org.antlr.v4.runtime.tree.ParseTree; //导入方法依赖的package包/类
public String visitWithoutTerminals(RuleNode node) {
    String result = this.defaultResult();
    int n = node.getChildCount();

    for(int i = 0; i < n && this.shouldVisitNextChild(node, result); ++i) {
        ParseTree c = node.getChild(i);
        if(c instanceof TerminalNode) continue;
        String childResult = c.accept(this);
        result = this.aggregateResult(result, childResult);
    }

    return result;
}
 
开发者ID:marcelganczak,项目名称:ts-swift-transpiler,代码行数:14,代码来源:Visitor.java

示例5: visitWithoutStrings

import org.antlr.v4.runtime.tree.ParseTree; //导入方法依赖的package包/类
public String visitWithoutStrings(RuleNode node, String string) {
    String result = this.defaultResult();
    int n = node.getChildCount();

    for(int i = 0; i < n && this.shouldVisitNextChild(node, result); ++i) {
        ParseTree c = node.getChild(i);
        if(string.contains(c.getText())) continue;
        String childResult = c instanceof TerminalNode ? printTerminalNode((TerminalNode) c) : c.accept(this);
        result = this.aggregateResult(result, childResult);
    }

    return result;
}
 
开发者ID:marcelganczak,项目名称:ts-swift-transpiler,代码行数:14,代码来源:Visitor.java

示例6: visitWithoutClasses

import org.antlr.v4.runtime.tree.ParseTree; //导入方法依赖的package包/类
public String visitWithoutClasses(RuleNode node, Class nodeType) {
    String result = this.defaultResult();
    int n = node.getChildCount();

    for(int i = 0; i < n && this.shouldVisitNextChild(node, result); ++i) {
        ParseTree c = node.getChild(i);
        if(c.getClass() == nodeType) continue;
        String childResult = c instanceof TerminalNode ? printTerminalNode((TerminalNode) c) : c.accept(this);
        result = this.aggregateResult(result, childResult);
    }

    return result;
}
 
开发者ID:marcelganczak,项目名称:ts-swift-transpiler,代码行数:14,代码来源:Visitor.java

示例7: visit

import org.antlr.v4.runtime.tree.ParseTree; //导入方法依赖的package包/类
@Override
public Expression visit(ParseTree tree) {
  return tree.accept(this);
}
 
开发者ID:VerifAPS,项目名称:stvs,代码行数:5,代码来源:ExpressionParser.java


注:本文中的org.antlr.v4.runtime.tree.ParseTree.accept方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。