public CastExpr(ASTList className, int dim, ASTree expr) { super(className, new ASTList(expr)); castType = CLASS; arrayDim = dim; }
public CastExpr(int type, int dim, ASTree expr) { super(null, new ASTList(expr)); castType = type; arrayDim = dim; }
public NewExpr(ASTList className, ASTList args) { super(className, new ASTList(args)); newArray = false; arrayType = CLASS; }
public CastExpr(ASTList className, int dim, ASTree expr) { super(className, new ASTList(expr)); castType = CLASS; arrayDim = dim; }
public static AssignExpr makeAssign(int op, ASTree oprand1, ASTree oprand2) { return new AssignExpr(op, oprand1, new ASTList(oprand2)); }
public static CallExpr makeCall(ASTree target, ASTree args) { return new CallExpr(target, new ASTList(args)); }
public static Stmnt make(int op, ASTree oprand1, ASTree oprand2) { return new Stmnt(op, oprand1, new ASTList(oprand2)); }
public static Expr make(int op, ASTree oprand1, ASTree oprand2) { return new Expr(op, oprand1, new ASTList(oprand2)); }
public static BinExpr makeBin(int op, ASTree oprand1, ASTree oprand2) { return new BinExpr(op, oprand1, new ASTList(oprand2)); }
public NewExpr(int type, ASTList arraySize, ArrayInit init) { super(null, new ASTList(arraySize)); newArray = true; arrayType = type; if (init != null) append(this, init); }
/** * Appends an object to a list. */ public static ASTList append(ASTList a, ASTree b) { return concat(a, new ASTList(b)); }
private Stmnt parseIf(SymbolTable tbl) throws CompileError { int t = lex.get(); // IF ASTree expr = parseParExpression(tbl); Stmnt thenp = parseStatement(tbl); Stmnt elsep; if (lex.lookAhead() == ELSE) { lex.get(); elsep = parseStatement(tbl); } else elsep = null; return new Stmnt(t, expr, new ASTList(thenp, new ASTList(elsep))); }
/** * Appends an object to a list. */ public static ASTList append(ASTList a, ASTree b) { return concat(a, new ASTList(b)); }
public NewExpr(int type, ASTList arraySize, ArrayInit init) { super(null, new ASTList(arraySize)); newArray = true; arrayType = type; if (init != null) append(this, init); }
private FieldDecl parseField(SymbolTable tbl, ASTList mods, Declarator d) throws CompileError { ASTree expr = null; if (lex.lookAhead() == '=') { lex.get(); expr = parseExpression(tbl); } int c = lex.get(); if (c == ';') return new FieldDecl(mods, new ASTList(d, new ASTList(expr))); else if (c == ',') throw new CompileError( "only one field can be declared in one declaration", lex); else throw new SyntaxError(lex); }
private static Expr makeAppendCall(ASTree target, ASTree arg) { return CallExpr.makeCall(Expr.make('.', target, new Member("append")), new ASTList(arg)); }
private ASTList parseMemberMods() { int t; ASTList list = null; while (true) { t = lex.lookAhead(); if (t == ABSTRACT || t == FINAL || t == PUBLIC || t == PROTECTED || t == PRIVATE || t == SYNCHRONIZED || t == STATIC || t == VOLATILE || t == TRANSIENT || t == STRICT) list = new ASTList(new Keyword(lex.get()), list); else break; } return list; }