use of de.be4.eventbalg.core.parser.node.TMultiCommentEnd in project probparsers by bendisposto.
the class EventBLexer method collectMultiLineComment.
private void collectMultiLineComment() throws EventBLexerException {
if (state.equals(State.MULTI_COMMENT)) {
if (token instanceof EOF) {
// tokenList.add(token);
throw new EventBLexerException(token, "Comment not closed");
}
/*
* Starting a new multiline comment, so first token is
* TMultiCommentStart
*/
if (commentStart == null) {
commentStart = (TMultiCommentStart) token;
commentBuffer = new StringBuilder();
token = null;
} else {
// end of comment reached?
if (token instanceof TMultiCommentEnd) {
token = new TComment(commentBuffer.toString(), commentStart.getLine(), commentStart.getPos());
commentStart = null;
commentBuffer = null;
state = State.NORMAL;
} else {
commentBuffer.append(token.getText());
token = null;
}
}
}
}
use of de.be4.eventbalg.core.parser.node.TMultiCommentEnd in project probparsers by bendisposto.
the class EventBLexer method collectMultiLineComment.
private void collectMultiLineComment() throws EventBLexerException {
if (state.equals(State.MULTI_COMMENT)) {
if (token instanceof EOF) {
// tokenList.add(token);
throw new EventBLexerException(token, "Comment not closed");
}
/*
* Starting a new multiline comment, so first token is
* TMultiCommentStart
*/
if (commentStart == null) {
commentStart = (TMultiCommentStart) token;
commentBuffer = new StringBuilder();
token = null;
} else {
// end of comment reached?
if (token instanceof TMultiCommentEnd) {
token = new TComment(commentBuffer.toString(), commentStart.getLine(), commentStart.getPos());
commentStart = null;
commentBuffer = null;
state = State.NORMAL;
} else {
commentBuffer.append(token.getText());
token = null;
}
}
}
}
Aggregations