public BasicsParser(ParserGroup group) { this.group = group; this.actions = new BasicsActions(group.getSource()); }
public boolean logLineComment(String text) { if (text.startsWith("//")) text = text.substring(2); Comment c = new Comment().astBlockComment(false).astContent(text); c.setPosition(new Position(startPos(), currentPos())); source.registerComment(getContext(), c); return true; } }
public boolean logComment(String text) { if (text.startsWith("//")) return logLineComment(text); else return logBlockComment(text); }
public Rule identifier() { return Sequence( identifierRaw().label("identifier"), actions.checkIfKeyword(text("identifier")), set(actions.createIdentifier(text("identifier"), node("identifier"))), optWS()); }
/** * Any comment (block, line, or javadoc) * * @see <a href="http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.7">JLS section 3.7</a> */ public Rule comment() { return Sequence( FirstOf(lineComment(), blockComment()), actions.logComment(lastText())); }
public Rule identifier() { return Sequence( identifierRaw().label("identifier"), actions.checkIfKeyword(text("identifier")), set(actions.createIdentifier(text("identifier"), node("identifier"))), optWS()); }
/** * Any comment (block, line, or javadoc) * * @see <a href="http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.7">JLS section 3.7</a> */ public Rule comment() { return Sequence( FirstOf(lineComment(), blockComment()), actions.logComment(lastText())); }
public boolean logBlockComment(String text) { if (text.startsWith("/*")) text = text.substring(2); if (text.endsWith("*/")) text = text.substring(0, text.length() - 2); Comment c = new Comment().astBlockComment(true).astContent(text); c.setPosition(new Position(startPos(), currentPos())); source.registerComment(getContext(), c); return true; }
public Rule identifier() { return Sequence( identifierRaw().label("identifier"), actions.checkIfKeyword(text("identifier")), set(actions.createIdentifier(text("identifier"), node("identifier"))), optWS()); }
public boolean logComment(String text) { if (text.startsWith("//")) return logLineComment(text); else return logBlockComment(text); }
public BasicsParser(ParserGroup group) { this.group = group; this.actions = new BasicsActions(group.getSource()); }
/** * Any comment (block, line, or javadoc) * * @see <a href="http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.7">JLS section 3.7</a> */ public Rule comment() { return Sequence( FirstOf(lineComment(), blockComment()), actions.logComment(lastText())); }
public boolean logBlockComment(String text) { if (text.startsWith("/*")) text = text.substring(2); if (text.endsWith("*/")) text = text.substring(0, text.length() - 2); Comment c = new Comment().astBlockComment(true).astContent(text); c.setPosition(new Position(startPos(), currentPos())); source.registerComment(getContext(), c); return true; }
public Rule dotIdentifier() { return Sequence( Ch('.'), optWS(), identifierRaw().label("identifier"), actions.checkIfKeyword(text("identifier")), set(actions.createIdentifier(text("identifier"), node("identifier"))), optWS()); }
public boolean logComment(String text) { if (text.startsWith("//")) return logLineComment(text); else return logBlockComment(text); }
public BasicsParser(ParserGroup group) { this.group = group; this.actions = new BasicsActions(group.getSource()); }
public boolean logBlockComment(String text) { if (text.startsWith("/*")) text = text.substring(2); if (text.endsWith("*/")) text = text.substring(0, text.length() - 2); Comment c = new Comment().astBlockComment(true).astContent(text); c.setPosition(new Position(startPos(), currentPos())); source.registerComment(getContext(), c); return true; }
public Rule dotIdentifier() { return Sequence( Ch('.'), optWS(), identifierRaw().label("identifier"), actions.checkIfKeyword(text("identifier")), set(actions.createIdentifier(text("identifier"), node("identifier"))), optWS()); }
public boolean logLineComment(String text) { if (text.startsWith("//")) text = text.substring(2); Comment c = new Comment().astBlockComment(false).astContent(text); c.setPosition(new Position(startPos(), currentPos())); source.registerComment(getContext(), c); return true; } }
public Rule dotIdentifier() { return Sequence( Ch('.'), optWS(), identifierRaw().label("identifier"), actions.checkIfKeyword(text("identifier")), set(actions.createIdentifier(text("identifier"), node("identifier"))), optWS()); }