| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- //Exprest:top//
- //Exprest:import//
- import java.util.*;
- // <exprest> **= <OP> <mult>
- public class Exprest /*Exprest:class*/ {
- public static final String $className = "Exprest";
- public static final String $ruleString =
- "<exprest> **= <OP> <mult>";
- public List<Token> opList;
- public List<Mult> multList;
- public Exprest(List<Token> opList, List<Mult> multList) {
- //Exprest:init//
- this.opList = opList;
- this.multList = multList;
- }
- public static Exprest parse(Scan scn$, Trace trace$) {
- if (trace$ != null)
- trace$ = trace$.nonterm("<exprest>", scn$.lno);
- List<Token> opList = new ArrayList<Token>();
- List<Mult> multList = new ArrayList<Mult>();
- while (true) {
- Token t$ = scn$.cur();
- Token.Match match$ = t$.match;
- switch(match$) {
- case OP:
- opList.add(scn$.match(Token.Match.OP, trace$));
- multList.add(Mult.parse(scn$, trace$));
- continue;
- default:
- return new Exprest(opList, multList);
- }
- }
- }
- //Exprest//
- }
|