Skip to content

Instantly share code, notes, and snippets.

@dilijev
Created Jan 20, 2013
Embed
What would you like to do?
Indent open braces, code on the same line as the open brace, further indenting the block, LISP style "if ... else if ... else" hanging indents. I don't even....
TOKEN gettoken()
{ int c, cclass;
TOKEN tok = (TOKEN) talloc(); /* = new token */
skipblanks(); /* and comments */
if ((c = peekchar()) != EOF)
{
cclass = CHARCLASS[c];
if (cclass == ALPHA)
identifier(tok);
else if (cclass == NUMERIC)
number(tok);
else if (c == '\'')
getstring(tok);
else special(tok);
}
else EOFFLG = 1;
if (DEBUGGETTOKEN != 0) printtoken(tok);
return(tok);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment