Exemplo n.º 1
0
  /*
   * adds definitions from a include-file to the compiled code
   */
  private void include(String file) throws IOException, ParseException {

    // lex
    Lexer lexInc = new Lexer(new FileInputStream(file));
    // parse

    Parser p = new Parser();
    includes.addAll(p.parseInclude(lexInc));
  }
Exemplo n.º 2
0
  private ArrayList<Definition> parse(Lexer lex) throws ParseException, IOException {
    if (s.useFile()) startTimer();

    Parser p = new Parser();

    ArrayList<Definition> defs = p.parse(lex);
    if (s.useFile()) stopTimer();

    // falls includes vorhanden, füge hinzu

    if (includes.size() != 0) {
      includes.addAll(defs);
      return includes;
    }
    return defs;
  }