Ejemplo n.º 1
0
 @Override
 public IScannerState handleCharacter(String ch, ITokenList list) throws ScannerException {
   if (ch.matches("=")) {
     return new BecomesState();
   } else {
     list.add(new Base(Terminals.COLON));
     return new DefaultState().handleCharacter(ch, list);
   }
 }
Ejemplo n.º 2
0
 @Override
 public IScannerState handleCharacter(String ch, ITokenList list) throws ScannerException {
   if (ch.matches("[0-9]")) {
     value += ch;
     return this;
   } else if (ch.matches("[']")) {
     return this;
   } else {
     list.add(new Literal(Integer.valueOf(value)));
     return new DefaultState().handleCharacter(ch, list);
   }
 }