public KObject eval(CTX ctx, String script, long uline) { ctx.gamma = new Gamma(); ctx.gamma.ks = this; List<Token> tls = new ArrayList<Token>(); int pos = tls.size(); tokenize(ctx, script, uline, tls); Block bk = Parser.newBlock(ctx, this, null, tls, pos, tls.size(), ';'); KArray.clear(tls, pos); return evalBlock(ctx, bk); }
public void tokenize(CTX ctx, String source, long uline, List<Token> toks) { int i, pos = toks.size(); TEnv tenv = new TEnv(source, uline, toks, 4, this); Tokenizer.tokenize(ctx, tenv); if (uline == 0) { for (i = pos; i < toks.size(); i++) { toks.get(i).uline = 0; } } }
private void parseSyntaxRule(CTX ctx, String rule, long uline, List<Token> a) { List<Token> tls = new ArrayList<Token>(); tokenize(ctx, rule, uline, tls); makeSyntaxRule(ctx, tls, 0, tls.size(), a); }