private CtField compileField(FieldDecl fd) throws CompileError, CannotCompileException { CtFieldWithInit f; Declarator d = fd.getDeclarator(); f = new CtFieldWithInit(gen.resolver.lookupClass(d), d.getVariable().get(), gen.getThisClass()); f.setModifiers(MemberResolver.getModifiers(fd.getModifiers())); if (fd.getInit() != null) f.setInit(fd.getInit()); return f; }
public ASTList getModifiers() { return (ASTList)getLeft(); }
public ASTree getInit() { return (ASTree)sublist(2).head(); }
public void atFieldDecl(FieldDecl field) throws CompileError { field.getInit().accept(this); }
public Declarator getDeclarator() { return (Declarator)tail().head(); }
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); }
@Override public void atFieldDecl(FieldDecl field) throws CompileError { field.getInit().accept(this); }
public Declarator getDeclarator() { return (Declarator)tail().head(); }
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 CtField compileField(FieldDecl fd) throws CompileError, CannotCompileException { CtFieldWithInit f; Declarator d = fd.getDeclarator(); f = new CtFieldWithInit(gen.resolver.lookupClass(d), d.getVariable().get(), gen.getThisClass()); f.setModifiers(MemberResolver.getModifiers(fd.getModifiers())); if (fd.getInit() != null) f.setInit(fd.getInit()); return f; }
public void atFieldDecl(FieldDecl field) throws CompileError { field.getInit().accept(this); }
public Declarator getDeclarator() { return (Declarator)tail().head(); }
public ASTree getInit() { return sublist(2).head(); }
public ASTList getModifiers() { return (ASTList)getLeft(); }
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 CtField compileField(FieldDecl fd) throws CompileError, CannotCompileException { CtFieldWithInit f; Declarator d = fd.getDeclarator(); f = new CtFieldWithInit(gen.resolver.lookupClass(d), d.getVariable().get(), gen.getThisClass()); f.setModifiers(MemberResolver.getModifiers(fd.getModifiers())); if (fd.getInit() != null) f.setInit(fd.getInit()); return f; }
public void atFieldDecl(FieldDecl field) throws CompileError { field.getInit().accept(this); }
public Declarator getDeclarator() { return (Declarator)tail().head(); }
public ASTree getInit() { return (ASTree)sublist(2).head(); }
public ASTList getModifiers() { return (ASTList)getLeft(); }