private void error(Token pptok, boolean is_error) throws IOException, LexerException { StringBuilder buf = new StringBuilder(); buf.append('#').append(pptok.getText()).append(' '); /* Peculiar construction to ditch first whitespace. */ Token tok = source_token_nonwhite(); ERROR: for (;;) { switch (tok.getType()) { case NL: case EOF: break ERROR; default: buf.append(tok.getText()); break; } tok = source_token(); } if (is_error) error(pptok, buf.toString()); else warning(pptok, buf.toString()); }
private void error(@Nonnull Token pptok, boolean is_error) throws IOException, LexerException { StringBuilder buf = new StringBuilder(); buf.append('#').append(pptok.getText()).append(' '); /* Peculiar construction to ditch first whitespace. */ Token tok = source_token_nonwhite(); ERROR: for (;;) { switch (tok.getType()) { case NL: case EOF: break ERROR; default: buf.append(tok.getText()); break; } tok = source_token(); } if (is_error) error(pptok, buf.toString()); else warning(pptok, buf.toString()); }
private void error(Token pptok, boolean is_error) throws IOException, LexerException { StringBuilder buf = new StringBuilder(); buf.append('#').append(pptok.getText()).append(' '); /* Peculiar construction to ditch first whitespace. */ Token tok = source_token_nonwhite(); ERROR: for (;;) { switch (tok.getType()) { case NL: case EOF: break ERROR; default: buf.append(tok.getText()); break; } tok = source_token(); } if (is_error) error(pptok, buf.toString()); else warning(pptok, buf.toString()); }
private Token undef() throws IOException, LexerException { Token tok = source_token_nonwhite(); if (tok.getType() != IDENTIFIER) { error(tok, "Expected identifier, not " + tok.getText()); if (tok.getType() == NL || tok.getType() == EOF) return tok; } else { Macro m = macros.get(tok.getText()); if (m != null) { /* XXX error if predefined */ macros.remove(m.getName()); } } return source_skipline(true); }
private Token undef() throws IOException, LexerException { Token tok = source_token_nonwhite(); if (tok.getType() != IDENTIFIER) { error(tok, "Expected identifier, not " + tok.getText()); if (tok.getType() == NL || tok.getType() == EOF) return tok; } else { Macro m = macros.get(tok.getText()); if (m != null) { /* XXX error if predefined */ macros.remove(m.getName()); } } return source_skipline(true); }
@Nonnull private Token undef() throws IOException, LexerException { Token tok = source_token_nonwhite(); if (tok.getType() != IDENTIFIER) { error(tok, "Expected identifier, not " + tok.getText()); if (tok.getType() == NL || tok.getType() == EOF) return tok; } else { Macro m = getMacro(tok.getText()); if (m != null) { /* XXX error if predefined */ macros.remove(m.getName()); } } return source_skipline(true); }
Token la = source_token_nonwhite(); boolean paren = false; if (la.getType() == '(') { paren = true; la = source_token_nonwhite(); la = source_token_nonwhite(); if (la.getType() != ')') { expr_untoken(la);
Token la = source_token_nonwhite(); boolean paren = false; if (la.getType() == '(') { paren = true; la = source_token_nonwhite(); la = source_token_nonwhite(); if (la.getType() != ')') { expr_untoken(la);
Token la = source_token_nonwhite(); boolean paren = false; if (la.getType() == '(') { paren = true; la = source_token_nonwhite(); la = source_token_nonwhite(); if (la.getType() != ')') { expr_untoken(la);
private Token define() throws IOException, LexerException { Token tok = source_token_nonwhite(); if (tok.getType() != IDENTIFIER) { error(tok, "Expected identifier"); tok = source_token_nonwhite(); if (tok.getType() != ')') { args = new ArrayList<String>(); tok = source_token_nonwhite(); switch (tok.getType()) { case ',': break; case ELLIPSIS: tok = source_token_nonwhite(); if (tok.getType() != ')') error(tok, tok = source_token_nonwhite(); tok = source_token_nonwhite(); EXPANSION: for (;;) { switch (tok.getType()) { m.addToken(Token.space); space = false; Token la = source_token_nonwhite(); if (la.getType() == IDENTIFIER &&
private Token define() throws IOException, LexerException { Token tok = source_token_nonwhite(); if (tok.getType() != IDENTIFIER) { error(tok, "Expected identifier"); tok = source_token_nonwhite(); if (tok.getType() != ')') { args = new ArrayList<String>(); tok = source_token_nonwhite(); switch (tok.getType()) { case ',': break; case ELLIPSIS: tok = source_token_nonwhite(); if (tok.getType() != ')') error(tok, tok = source_token_nonwhite(); tok = source_token_nonwhite(); EXPANSION: for (;;) { switch (tok.getType()) { m.addToken(Token.space); space = false; Token la = source_token_nonwhite(); if (la.getType() == IDENTIFIER &&
private Token define() throws IOException, LexerException { Token tok = source_token_nonwhite(); if (tok.getType() != IDENTIFIER) { error(tok, "Expected identifier"); tok = source_token_nonwhite(); if (tok.getType() != ')') { args = new ArrayList<String>(); tok = source_token_nonwhite(); switch (tok.getType()) { case ',': break; case ELLIPSIS: tok = source_token_nonwhite(); if (tok.getType() != ')') error(tok, tok = source_token_nonwhite(); tok = source_token_nonwhite(); EXPANSION: for (;;) { m.addToken(Token.space); space = false; Token la = source_token_nonwhite(); if (la.getType() == IDENTIFIER
tok = source_token_nonwhite(); tok = source_token_nonwhite(); tok = source_token_nonwhite(); if (tok.getType() != IDENTIFIER) { error(tok,
tok = source_token_nonwhite(); tok = source_token_nonwhite(); tok = source_token_nonwhite(); if (tok.getType() != IDENTIFIER) { error(tok,
tok = source_token_nonwhite(); return source_skipline(false); } else { tok = source_token_nonwhite(); return source_skipline(false); } else { tok = source_token_nonwhite(); if (tok.getType() != IDENTIFIER) { error(tok,