1 package org.simantics.scl.compiler.parser.regexp;
3 import org.simantics.scl.compiler.parser.regexp.automata.NFA;
5 public class RAtom extends Regexp {
6 public final int symbolId;
8 public RAtom(int symbolId) {
9 this.symbolId = symbolId;
13 protected void buildAutomaton(NFA aut, int inState, int outState) {
14 aut.addTransition(inState, symbolId, outState);
18 protected void toString(StringBuilder b, int prec) {
19 b.append((char)symbolId);
23 public void toString(StringBuilder b, Namer grammar, int prec) {
24 if(symbolId == 0x80000000)
27 b.append(grammar.getName(symbolId));
31 protected int getTypeId() {
36 public boolean equals(Object obj) {
39 if(obj == null || obj.getClass() != getClass())
41 RAtom other = (RAtom)obj;
42 return symbolId == other.symbolId;
46 public int hashCode() {
47 return 31*symbolId + 46;
51 public boolean isNullable() {