org.antlr.v4.tool.Grammar.defineRule()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(2.1k)|赞(0)|评价(0)|浏览(103)

本文整理了Java中org.antlr.v4.tool.Grammar.defineRule()方法的一些代码示例,展示了Grammar.defineRule()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Grammar.defineRule()方法的具体详情如下:
包路径:org.antlr.v4.tool.Grammar
类名称:Grammar
方法名:defineRule

Grammar.defineRule介绍

[英]Define the specified rule in the grammar. This method assigns the rule's Rule#index according to the #ruleNumber field, and adds the Rule instance to #rules and #indexToRule.
[中]在语法中定义指定的规则。此方法根据#ruleNumber字段分配规则的#索引,并将规则实例添加到#rules和#indexToRule。

代码示例

代码示例来源:origin: org.antlr/antlr4

@Override
public boolean defineRule(Rule r) {
  if (!super.defineRule(r)) {
    return false;
  }
  if ( modes==null ) modes = new MultiMap<String, Rule>();
  modes.map(r.mode, r);
  return true;
}

代码示例来源:origin: uk.co.nichesolutions/antlr4

@Override
public boolean defineRule(Rule r) {
  if (!super.defineRule(r)) {
    return false;
  }
  if ( modes==null ) modes = new MultiMap<String, Rule>();
  modes.map(r.mode, r);
  return true;
}

代码示例来源:origin: io.virtdata/virtdata-lib-realer

@Override
public boolean defineRule(Rule r) {
  if (!super.defineRule(r)) {
    return false;
  }
  if ( modes==null ) modes = new MultiMap<String, Rule>();
  modes.map(r.mode, r);
  return true;
}

代码示例来源:origin: com.tunnelvisionlabs/antlr4

@Override
public boolean defineRule(Rule r) {
  if (!super.defineRule(r)) {
    return false;
  }
  if ( modes==null ) modes = new MultiMap<String, Rule>();
  modes.map(r.mode, r);
  return true;
}

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

@Override
public boolean defineRule(Rule r) {
  if (!super.defineRule(r)) {
    return false;
  }
  if ( modes==null ) modes = new MultiMap<String, Rule>();
  modes.map(r.mode, r);
  return true;
}

代码示例来源:origin: com.tunnelvisionlabs/antlr4

_g.defineRule(variant);
for (int i = 0; i < alts.size(); i++) {
  variant.alt[i + 1].ast = (AltAST)alts.get(i);
_g.defineRule(variant);
for (int i = 0; i < alts.size(); i++) {
  variant.alt[i + 1].ast = (AltAST)alts.get(i);

代码示例来源:origin: com.tunnelvisionlabs/antlr4

g.defineRule(r);

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

g.defineRule(r);

代码示例来源:origin: uk.co.nichesolutions/antlr4

g.defineRule(r);

代码示例来源:origin: org.antlr/antlr4

g.defineRule(r);

代码示例来源:origin: io.virtdata/virtdata-lib-realer

g.defineRule(r);

相关文章