private boolean mustMatchToken(int toMatch, String messageId) throws IOException { return mustMatchToken(toMatch, messageId, ts.tokenBeg, ts.tokenEnd - ts.tokenBeg); }
private boolean mustMatchToken(int toMatch, String messageId) throws IOException { return mustMatchToken(toMatch, messageId, ts.tokenBeg, ts.tokenEnd - ts.tokenBeg); }
private boolean mustMatchToken(int toMatch, String messageId) throws IOException { return mustMatchToken(toMatch, messageId, ts.tokenBeg, ts.tokenEnd - ts.tokenBeg); }
private boolean mustMatchToken(int toMatch, String messageId) throws IOException { return mustMatchToken(toMatch, messageId, ts.tokenBeg, ts.tokenEnd - ts.tokenBeg); }
private ConditionData condition() throws IOException { ConditionData data = new ConditionData(); if (mustMatchToken(Token.LP, "msg.no.paren.cond")) data.lp = ts.tokenBeg; data.condition = expr(); if (mustMatchToken(Token.RP, "msg.no.paren.after.cond")) data.rp = ts.tokenBeg; // Report strict warning on code like "if (a = 7) ...". Suppress the // warning if the condition is parenthesized, like "if ((a = 7)) ...". if (data.condition instanceof Assignment) { addStrictWarning("msg.equal.as.assign", "", data.condition.getPosition(), data.condition.getLength()); } return data; }
private ConditionData condition() throws IOException { ConditionData data = new ConditionData(); if (mustMatchToken(Token.LP, "msg.no.paren.cond")) data.lp = ts.tokenBeg; data.condition = expr(); if (mustMatchToken(Token.RP, "msg.no.paren.after.cond")) data.rp = ts.tokenBeg; // Report strict warning on code like "if (a = 7) ...". Suppress the // warning if the condition is parenthesized, like "if ((a = 7)) ...". if (data.condition instanceof Assignment) { addStrictWarning("msg.equal.as.assign", "", data.condition.getPosition(), data.condition.getLength()); } return data; }
private ConditionData condition() throws IOException { ConditionData data = new ConditionData(); if (mustMatchToken(Token.LP, "msg.no.paren.cond")) data.lp = ts.tokenBeg; data.condition = expr(); if (mustMatchToken(Token.RP, "msg.no.paren.after.cond")) data.rp = ts.tokenBeg; // Report strict warning on code like "if (a = 7) ...". Suppress the // warning if the condition is parenthesized, like "if ((a = 7)) ...". if (data.condition instanceof Assignment) { addStrictWarning("msg.equal.as.assign", "", data.condition.getPosition(), data.condition.getLength()); } return data; }
private ConditionData condition() throws IOException { ConditionData data = new ConditionData(); if (mustMatchToken(Token.LP, "msg.no.paren.cond")) data.lp = ts.tokenBeg; data.condition = expr(); if (mustMatchToken(Token.RP, "msg.no.paren.after.cond")) data.rp = ts.tokenBeg; // Report strict warning on code like "if (a = 7) ...". Suppress the // warning if the condition is parenthesized, like "if ((a = 7)) ...". if (data.condition instanceof Assignment) { addStrictWarning("msg.equal.as.assign", "", data.condition.getPosition(), data.condition.getLength()); } return data; }
private void plainProperty(ObjArray elems, Object property) throws IOException { mustMatchToken(Token.COLON, "msg.no.colon.prop"); // OBJLIT is used as ':' in object literal for // decompilation to solve spacing ambiguity. decompiler.addToken(Token.OBJECTLIT); elems.add(property); elems.add(assignExpr(false)); }
private void plainProperty(ObjArray elems, Object property) throws IOException { mustMatchToken(Token.COLON, "msg.no.colon.prop"); // OBJLIT is used as ':' in object literal for // decompilation to solve spacing ambiguity. decompiler.addToken(Token.OBJECTLIT); elems.add(property); elems.add(assignExpr(false)); }
private void plainProperty(ObjArray elems, Object property) throws IOException { mustMatchToken(Token.COLON, "msg.no.colon.prop"); // OBJLIT is used as ':' in object literal for // decompilation to solve spacing ambiguity. decompiler.addToken(Token.OBJECTLIT); elems.add(property); elems.add(assignExpr(false)); }
private Node condition() throws IOException, ParserException { mustMatchToken(Token.LP, "msg.no.paren.cond"); decompiler.addToken(Token.LP); Node pn = expr(false); mustMatchToken(Token.RP, "msg.no.paren.after.cond"); decompiler.addToken(Token.RP); // Report strict warning on code like "if (a = 7) ...". Suppress the // warning if the condition is parenthesized, like "if ((a = 7)) ...". if (pn.getProp(Node.PARENTHESIZED_PROP) == null && (pn.getType() == Token.SETNAME || pn.getType() == Token.SETPROP || pn.getType() == Token.SETELEM)) { addStrictWarning("msg.equal.as.assign", ""); } return pn; }
private Node condition() throws IOException, ParserException { mustMatchToken(Token.LP, "msg.no.paren.cond"); decompiler.addToken(Token.LP); Node pn = expr(false); mustMatchToken(Token.RP, "msg.no.paren.after.cond"); decompiler.addToken(Token.RP); // Report strict warning on code like "if (a = 7) ...". Suppress the // warning if the condition is parenthesized, like "if ((a = 7)) ...". if (pn.getProp(Node.PARENTHESIZED_PROP) == null && (pn.getType() == Token.SETNAME || pn.getType() == Token.SETPROP || pn.getType() == Token.SETELEM)) { addStrictWarning("msg.equal.as.assign", ""); } return pn; }
private Node condExpr(boolean inForInit) throws IOException, ParserException { Node pn = orExpr(inForInit); if (matchToken(Token.HOOK)) { decompiler.addToken(Token.HOOK); Node ifTrue = assignExpr(false); mustMatchToken(Token.COLON, "msg.no.colon.cond"); decompiler.addToken(Token.COLON); Node ifFalse = assignExpr(inForInit); return nf.createCondExpr(pn, ifTrue, ifFalse); } return pn; }
private void argumentList(Node listNode) throws IOException, ParserException { boolean matched; matched = matchToken(Token.RP); if (!matched) { boolean first = true; do { if (!first) decompiler.addToken(Token.COMMA); first = false; nf.addChildToBack(listNode, assignExpr(false)); } while (matchToken(Token.COMMA)); mustMatchToken(Token.RP, "msg.no.paren.arg"); } decompiler.addToken(Token.RP); }
private void argumentList(Node listNode) throws IOException, ParserException { boolean matched; matched = matchToken(Token.RP); if (!matched) { boolean first = true; do { if (!first) decompiler.addToken(Token.COMMA); first = false; nf.addChildToBack(listNode, assignExpr(false)); } while (matchToken(Token.COMMA)); mustMatchToken(Token.RP, "msg.no.paren.arg"); } decompiler.addToken(Token.RP); }
private Node condExpr(boolean inForInit) throws IOException, ParserException { Node pn = orExpr(inForInit); if (matchToken(Token.HOOK)) { decompiler.addToken(Token.HOOK); Node ifTrue = assignExpr(false); mustMatchToken(Token.COLON, "msg.no.colon.cond"); decompiler.addToken(Token.COLON); Node ifFalse = assignExpr(inForInit); return nf.createCondExpr(pn, ifTrue, ifFalse); } return pn; }
private Node condExpr(boolean inForInit) throws IOException, ParserException { Node pn = orExpr(inForInit); if (matchToken(Token.HOOK)) { decompiler.addToken(Token.HOOK); Node ifTrue = assignExpr(false); mustMatchToken(Token.COLON, "msg.no.colon.cond"); decompiler.addToken(Token.COLON); Node ifFalse = assignExpr(inForInit); return nf.createCondExpr(pn, ifTrue, ifFalse); } return pn; }
private AstNode block() throws IOException { if (currentToken != Token.LC) codeBug(); consumeToken(); int pos = ts.tokenBeg; Scope block = new Scope(pos); block.setLineno(ts.lineno); pushScope(block); try { statements(block); mustMatchToken(Token.RC, "msg.no.brace.block"); block.setLength(ts.tokenEnd - pos); return block; } finally { popScope(); } }
private AstNode block() throws IOException { if (currentToken != Token.LC) codeBug(); consumeToken(); int pos = ts.tokenBeg; Scope block = new Scope(pos); block.setLineno(ts.lineno); pushScope(block); try { statements(block); mustMatchToken(Token.RC, "msg.no.brace.block"); block.setLength(ts.tokenEnd - pos); return block; } finally { popScope(); } }