1 package org.simantics.scl.compiler.parser.grammar;
3 import org.simantics.scl.compiler.parser.regexp.Regexp;
5 import gnu.trove.map.hash.TIntByteHashMap;
7 public class Production {
8 public final String name;
10 public final Regexp rhs;
11 public final TIntByteHashMap annotations;
13 public Production(String name, int lhs, Regexp rhs,
14 TIntByteHashMap annotations) {
18 this.annotations = annotations;
21 public String toString(Grammar grammar) {
22 StringBuilder b = new StringBuilder();
23 b.append(grammar.getName(lhs));
25 rhs.toString(b, grammar, 0);