public Rule(String pattern,Object tokenType,String nextState){
  this.pattern=Pattern.compile(pattern);
  this.tokenType=tokenType;
  this.nextState=nextState;
}

public Rule ( String pattern , Object tokenType , String nextState ) { this . pattern = Pattern . compile ( pattern ) ; this . tokenType = tokenType ; this . nextState = nextState ; }
initializes a new instance with the specified regular expression pattern , a type for generated tokens , and a name of a grammar state that should be triggered .
