Package net.sf.lapg.api

Examples of net.sf.lapg.api.Lexem


    ljmpset = new int[nterms];
    ljmp = new int[nterms][];
    lname = new String[nterms];

    for (int i = 0; i < nterms; i++) {
      Lexem l = myLexems[i];
      totalgroups |= l.getGroups();

      if (l.getGroups() == 0) {
        status.report(ProcessingStatus.KIND_ERROR, l.getSymbol().getName() + ": defined lexem without a group", l);
        success = false;
      }

      if (l.getSymbol().getName().equals("error")) {
        status.report(ProcessingStatus.KIND_ERROR, "error token must be defined without regular expression", l);
        success = false;
        continue;
      }

      try {
        int[] lexem_sym = rp.compile(i, l.getSymbol().getName(), l.getRegexp());

        lnum[i] = l.getSymbol().getIndex();
        lprio[i] = l.getPriority();
        group[i] = l.getGroups();
        lindex[i] = nsit;
        llen[i] = lexem_sym.length;
        ljmpset[i] = (((lexem_sym.length) + LexConstants.BITS - 1) / LexConstants.BITS);
        ljmp[i] = new int[lexem_sym.length * ljmpset[i]];
        lname[i] = l.getSymbol().getName();

        Arrays.fill(ljmp[i], 0);
        syms.add(lexem_sym);
        nsit += lexem_sym.length;
      } catch(RegexpParseException ex) {
        status.report(ProcessingStatus.KIND_ERROR, l.getSymbol().getName() + ": " + ex.getMessage(), l);
        success = false;
      }
    }
    if(!success) {
      return false;
View Full Code Here

TOP

Related Classes of net.sf.lapg.api.Lexem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.