public void nextToken() { S.nextToken(); token = S.token(); }
public void nextToken() { S.nextToken(); token = S.token(); }
/** BracketsOpt = {"[" "]"} */ private JCExpression bracketsOpt(JCExpression t) { if (S.token() == LBRACKET) { int pos = S.pos(); S.nextToken(); t = bracketsOptCont(t, pos); F.at(pos); } return t; }
/** BracketsOpt = {"[" "]"} */ private JCExpression bracketsOpt(JCExpression t) { if (S.token() == LBRACKET) { int pos = S.pos(); S.nextToken(); t = bracketsOptCont(t, pos); F.at(pos); } return t; }
/** BasicType = BYTE | SHORT | CHAR | INT | LONG | FLOAT | DOUBLE | BOOLEAN */ JCPrimitiveTypeTree basicType() { JCPrimitiveTypeTree t = to(F.at(S.pos()).TypeIdent(typetag(S.token()))); S.nextToken(); return t; }
/** If next input token matches given token, skip it, otherwise report * an error. */ public void accept(Token token) { if (S.token() == token) { S.nextToken(); } else { setErrorEndPos(S.pos()); reportSyntaxError(S.prevEndPos(), "expected", keywords.token2string(token)); } }
/** If next input token matches given token, skip it, otherwise report * an error. */ public void accept(Token token) { if (S.token() == token) { S.nextToken(); } else { setErrorEndPos(S.pos()); reportSyntaxError(S.prevEndPos(), "expected", keywords.token2string(token)); } }
/** BasicType = BYTE | SHORT | CHAR | INT | LONG | FLOAT | DOUBLE | BOOLEAN */ JCPrimitiveTypeTree basicType() { JCPrimitiveTypeTree t = to(F.at(S.pos()).TypeIdent(typetag(S.token()))); S.nextToken(); return t; }
/** QualidentList = Qualident {"," Qualident} */ List<JCExpression> qualidentList() { ListBuffer<JCExpression> ts = new ListBuffer<JCExpression>(); ts.append(qualident()); while (S.token() == COMMA) { S.nextToken(); ts.append(qualident()); } return ts.toList(); }
/** QualidentList = Qualident {"," Qualident} */ List<JCExpression> qualidentList() { ListBuffer<JCExpression> ts = new ListBuffer<JCExpression>(); ts.append(qualident()); while (S.token() == COMMA) { S.nextToken(); ts.append(qualident()); } return ts.toList(); }
/** TypeList = Type {"," Type} */ List<JCExpression> typeList() { ListBuffer<JCExpression> ts = new ListBuffer<JCExpression>(); ts.append(type()); while (S.token() == COMMA) { S.nextToken(); ts.append(type()); } return ts.toList(); }
/** TypeList = Type {"," Type} */ List<JCExpression> typeList() { ListBuffer<JCExpression> ts = new ListBuffer<JCExpression>(); ts.append(type()); while (S.token() == COMMA) { S.nextToken(); ts.append(type()); } return ts.toList(); }
/** Expression1Rest = ["?" Expression ":" Expression1] */ JCExpression term1Rest(JCExpression t) { if (S.token() == QUES) { int pos = S.pos(); S.nextToken(); JCExpression t1 = term(); accept(COLON); JCExpression t2 = term1(); return F.at(pos).Conditional(t, t1, t2); } else { return t; } }
/** AnnotationsOpt = { '@' Annotation } */ List<JCAnnotation> annotationsOpt() { if (S.token() != MONKEYS_AT) return List.nil(); // optimization ListBuffer<JCAnnotation> buf = new ListBuffer<JCAnnotation>(); while (S.token() == MONKEYS_AT) { int pos = S.pos(); S.nextToken(); buf.append(annotation(pos)); } return buf.toList(); }
/** AnnotationsOpt = { '@' Annotation } */ List<JCAnnotation> annotationsOpt() { if (S.token() != MONKEYS_AT) return List.nil(); // optimization ListBuffer<JCAnnotation> buf = new ListBuffer<JCAnnotation>(); while (S.token() == MONKEYS_AT) { int pos = S.pos(); S.nextToken(); buf.append(annotation(pos)); } return buf.toList(); }
/** TypeDeclaration = ClassOrInterfaceOrEnumDeclaration * | ";" */ JCTree typeDeclaration(JCModifiers mods) { int pos = S.pos(); if (mods == null && S.token() == SEMI) { S.nextToken(); return toP(F.at(pos).Skip()); } else { String dc = S.docComment(); return classOrInterfaceOrEnumDeclaration(modifiersOpt(mods), dc); } }
/** TypeDeclaration = ClassOrInterfaceOrEnumDeclaration * | ";" */ JCTree typeDeclaration(JCModifiers mods) { int pos = S.pos(); if (mods == null && S.token() == SEMI) { S.nextToken(); return toP(F.at(pos).Skip()); } else { String dc = S.docComment(); return classOrInterfaceOrEnumDeclaration(modifiersOpt(mods), dc); } }
/** AnnotationFieldValues = "(" [ AnnotationFieldValue { "," AnnotationFieldValue } ] ")" */ List<JCExpression> annotationFieldValues() { accept(LPAREN); ListBuffer<JCExpression> buf = new ListBuffer<JCExpression>(); if (S.token() != RPAREN) { buf.append(annotationFieldValue()); while (S.token() == COMMA) { S.nextToken(); buf.append(annotationFieldValue()); } } accept(RPAREN); return buf.toList(); }
/** * Qualident = Ident { DOT Ident } */ public JCExpression qualident() { JCExpression t = toP(F.at(S.pos()).Ident(ident())); while (S.token() == DOT) { int pos = S.pos(); S.nextToken(); t = toP(F.at(pos).Select(t, ident())); } return t; }
/** * Qualident = Ident { DOT Ident } */ public JCExpression qualident() { JCExpression t = toP(F.at(S.pos()).Ident(ident())); while (S.token() == DOT) { int pos = S.pos(); S.nextToken(); t = toP(F.at(pos).Select(t, ident())); } return t; }