optimization pass thru parser
[henge/apc.git] / src / lexer.c
index b01b292..362d62b 100644 (file)
@@ -113,7 +113,6 @@ int lexer_init
    printing is skipped.  In all other cases, 'yylval' is set, and the token's
    integer representation is returned.
 */
-int lexer
 #define $($)#$
 #define SCAN_ERROR -1
 #define TK_EMPTY   (TK_STACKP == TK_STACKX)
@@ -122,6 +121,7 @@ int lexer
     fprintf(stderr,__VA_ARGS__);               \
     goto done;                                 \
   } while (0)
+int lexer
 ()
 { struct tok token;
    start:
@@ -153,10 +153,12 @@ int lexer
 /* Token Receiver
    This receiver takes a struct tok and pushes it to the FIFO stack.
 */
-void lexer_pushtok
 #define $($)#$ //stringifier
 #define ERR_TK "Fatal: Generated over " $(TK_STACKSIZE) " tokens in one pass."
-( int tok, YYSTYPE lval )
+void lexer_pushtok
+( int     tok,
+  YYSTYPE lval
+)
 { if (TK_LEN() >= TK_STACKSIZE)
     { fprintf(stderr, ERR_TK);
       exit(EXIT_FAILURE);
@@ -167,8 +169,8 @@ void lexer_pushtok
 /* Lexical analysis of a file
    Strips a filename to its base name, then sends it to lexer_lex
 */
-int lexer_lexfile
 #define HIDDEN_WARNING "%s is hidden and will not be parsed!\n", filename
+int lexer_lexfile
 ( const uint8_t  *filename
 )
 { static uint8_t fname[FNAME_MAX];
@@ -207,7 +209,8 @@ uint8_t const* lexer_get_current_filepath
 /* Scan filename and push the its tokens
    onto the stack */
 int lexer_lexfilename
-(uint8_t* str)
+( uint8_t* str
+)
 { int ntok, len;
   uint8_t *filepath;