diff options
author | Jörg Mayer <jmayer@loplof.de> | 2002-08-28 21:04:11 +0000 |
---|---|---|
committer | Jörg Mayer <jmayer@loplof.de> | 2002-08-28 21:04:11 +0000 |
commit | 7c4176d8688d6642026d3d322570663c9655c7db (patch) | |
tree | fb24347c14c65d6b8d7f7e93e4060abbb7217e0c /tools/lemon | |
parent | 48be4e530d6635dbf1ef1dafa984c2060f3caa8a (diff) |
Removed trailing whitespaces from .h and .c files using the
winapi_cleanup tool written by Patrik Stridvall for the wine
project.
svn path=/trunk/; revision=6117
Diffstat (limited to 'tools/lemon')
-rw-r--r-- | tools/lemon/lemon.c | 36 | ||||
-rw-r--r-- | tools/lemon/lempar.c | 30 |
2 files changed, 33 insertions, 33 deletions
diff --git a/tools/lemon/lemon.c b/tools/lemon/lemon.c index f1cd86a734..a2755080af 100644 --- a/tools/lemon/lemon.c +++ b/tools/lemon/lemon.c @@ -15,7 +15,7 @@ ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** General Public License for more details. -** +** ** You should have received a copy of the GNU General Public ** License along with this library; if not, write to the ** Free Software Foundation, Inc., 59 Temple Place - Suite 330, @@ -25,7 +25,7 @@ ** drh@acm.org ** http://www.hwaci.com/drh/ ** -** $Id: lemon.c,v 1.13 2002/05/04 10:16:12 guy Exp $ +** $Id: lemon.c,v 1.14 2002/08/28 21:04:11 jmayer Exp $ */ #include <stdio.h> #include <stdarg.h> @@ -435,7 +435,7 @@ void myassert(char *file, int line) */ /* Find a precedence symbol of every rule in the grammar. -** +** ** Those rules which have a precedence symbol coded in the input ** grammar using the "[symbol]" construct will already have the ** rp->precsym field filled. Other rules take as their precedence @@ -720,7 +720,7 @@ void FindFollowSets(struct lemon *lemp) cfp->status = INCOMPLETE; } } - + do{ progress = 0; for(i=0; i<lemp->nstate; i++){ @@ -751,7 +751,7 @@ void FindActions(struct lemon *lemp) struct symbol *sp; struct rule *rp; - /* Add all of the reduce actions + /* Add all of the reduce actions ** A reduce action is added for each element of the followset of ** a configuration which has its dot at the extreme right. */ @@ -1225,7 +1225,7 @@ int main(int argc _U_, char **argv) "Copyright 1991-1997 by D. Richard Hipp\n" "Freely distributable under the GNU Public License.\n" ); - exit(0); + exit(0); } if( optnargs()!=1 ){ fprintf(stderr,"Exactly one filename argument is required.\n"); @@ -1881,7 +1881,7 @@ to follow the previous rule."); case IN_RHS: if( x[0]=='.' ){ struct rule *rp; - rp = (struct rule *)malloc( sizeof(struct rule) + + rp = (struct rule *)malloc( sizeof(struct rule) + sizeof(struct symbol*)*psp->nrhs + sizeof(char*)*psp->nrhs ); if( rp==0 ){ ErrorMsg(psp->filename,psp->tokenlineno, @@ -2389,7 +2389,7 @@ PRIVATE FILE *file_open(struct lemon *lemp, char *suffix, char *mode) return fp; } -/* Duplicate the input file without comments and without actions +/* Duplicate the input file without comments and without actions ** on rules */ void Reprint(struct lemon *lemp) { @@ -2743,7 +2743,7 @@ int has_destructor(struct symbol *sp, struct lemon *lemp) return ret; } -/* +/* ** Generate code which executes when the rule "rp" is reduced. Write ** the code to "out". Make sure lineno stays up-to-date. */ @@ -3024,7 +3024,7 @@ void ReportTable( /* Generate the action table. ** - ** Each entry in the action table is an element of the following + ** Each entry in the action table is an element of the following ** structure: ** struct yyActionEntry { ** YYCODETYPE lookahead; @@ -3104,7 +3104,7 @@ void ReportTable( fprintf(out,"0 }, /* "); } PrintAction(table[j],out,22); - fprintf(out," */\n"); + fprintf(out," */\n"); } lineno++; } @@ -3146,7 +3146,7 @@ void ReportTable( tplt_xfer(lemp->name,in,out,&lineno); /* Generate code which executes every time a symbol is popped from - ** the stack while processing errors or while destroying the parser. + ** the stack while processing errors or while destroying the parser. ** (In other words, generate the %destructor actions) */ if( lemp->tokendest ){ for(i=0; i<lemp->nsymbol; i++){ @@ -3173,7 +3173,7 @@ void ReportTable( tplt_print(out,lemp,lemp->overflow,lemp->overflowln,&lineno); tplt_xfer(lemp->name,in,out,&lineno); - /* Generate the table of rule information + /* Generate the table of rule information ** ** Note: This code depends on the fact that rules are number ** sequentually beginning with 0. @@ -3242,7 +3242,7 @@ void ReportHeader(struct lemon *lemp) for(i=1; i<lemp->nterminal; i++){ fprintf(out,"#define %s%-30s %2d\n",prefix,lemp->symbols[i]->name,i); } - fclose(out); + fclose(out); } return; } @@ -3415,7 +3415,7 @@ void Strsafe_init(void){ if( x1a ){ x1a->size = 1024; x1a->count = 0; - x1a->tbl = (x1node*)malloc( + x1a->tbl = (x1node*)malloc( (sizeof(x1node) + sizeof(x1node*))*1024 ); if( x1a->tbl==0 ){ free(x1a); @@ -3576,7 +3576,7 @@ void Symbol_init(void){ if( x2a ){ x2a->size = 128; x2a->count = 0; - x2a->tbl = (x2node*)malloc( + x2a->tbl = (x2node*)malloc( (sizeof(x2node) + sizeof(x2node*))*128 ); if( x2a->tbl==0 ){ free(x2a); @@ -3774,7 +3774,7 @@ void State_init(void){ if( x3a ){ x3a->size = 128; x3a->count = 0; - x3a->tbl = (x3node*)malloc( + x3a->tbl = (x3node*)malloc( (sizeof(x3node) + sizeof(x3node*))*128 ); if( x3a->tbl==0 ){ free(x3a); @@ -3916,7 +3916,7 @@ void Configtable_init(void){ if( x4a ){ x4a->size = 64; x4a->count = 0; - x4a->tbl = (x4node*)malloc( + x4a->tbl = (x4node*)malloc( (sizeof(x4node) + sizeof(x4node*))*64 ); if( x4a->tbl==0 ){ free(x4a); diff --git a/tools/lemon/lempar.c b/tools/lemon/lempar.c index 9c3b8e61ff..03e1722a17 100644 --- a/tools/lemon/lempar.c +++ b/tools/lemon/lempar.c @@ -5,12 +5,12 @@ ** modify it under the terms of the GNU Library General Public ** License as published by the Free Software Foundation; either ** version 2 of the License, or (at your option) any later version. -** +** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Library General Public License for more details. -** +** ** You should have received a copy of the GNU Library General Public ** License along with this library; if not, write to the ** Free Software Foundation, Inc., 59 Temple Place - Suite 330, @@ -25,10 +25,10 @@ /* Next is all token values, in a form suitable for use by makeheaders. ** This section will be null unless lemon is run with the -m switch. */ -/* +/* ** These constants (all generated automatically by the parser generator) ** specify the various kinds of tokens (terminals) that the parser -** understands. +** understands. ** ** Each symbol here is a terminal symbol in the grammar. */ @@ -46,13 +46,13 @@ ** and nonterminals. "int" is used otherwise. ** YYNOCODE is a number of type YYCODETYPE which corresponds ** to no legal terminal or nonterminal number. This -** number is used to fill in empty slots of the hash +** number is used to fill in empty slots of the hash ** table. ** YYACTIONTYPE is the data type used for storing terminal ** and nonterminal numbers. "unsigned char" is ** used if there are fewer than 250 rules and ** states combined. "int" is used otherwise. -** ParseTOKENTYPE is the data type used for minor tokens given +** ParseTOKENTYPE is the data type used for minor tokens given ** directly to the parser from the tokenizer. ** YYMINORTYPE is the data type used for all minor tokens. ** This is typically a union of many types, one of @@ -107,7 +107,7 @@ static struct yyActionEntry yyActionTable[] = { ** + A pointer to the start of the action hash table in yyActionTable. ** ** + A mask used to hash the look-ahead token. The mask is an integer -** which is one less than the size of the hash table. +** which is one less than the size of the hash table. ** ** + The default action. This is the action to take if no entry for ** the given look-ahead is found in the action hash table. @@ -156,10 +156,10 @@ typedef struct yyParser yyParser; static FILE *yyTraceFILE = 0; static char *yyTracePrompt = 0; -/* +/* ** Turn parser tracing on by giving a stream to which to write the trace ** and a prompt to preface each trace message. Tracing is turned off -** by making either argument NULL +** by making either argument NULL ** ** Inputs: ** <ul> @@ -182,7 +182,7 @@ void ParseTrace(FILE *TraceFILE, char *zTracePrompt){ /* For tracing shifts, the names of all terminals and nonterminals ** are required. The following table supplies these names */ -static char *yyTokenName[] = { +static char *yyTokenName[] = { %% }; #define YYTRACE(X) if( yyTraceFILE ) fprintf(yyTraceFILE,"%sReduce [%s].\n",yyTracePrompt,X); @@ -190,7 +190,7 @@ static char *yyTokenName[] = { #define YYTRACE(X) #endif -/* +/* ** This function allocates a new parser. ** The only argument is a pointer to a function which works like ** malloc. @@ -221,7 +221,7 @@ static void yy_destructor(YYCODETYPE yymajor, YYMINORTYPE *yypminor){ /* Here is inserted the actions which take place when a ** terminal or non-terminal is destroyed. This can happen ** when the symbol is popped from the stack during a - ** reduce or during error processing or when a parser is + ** reduce or during error processing or when a parser is ** being destroyed before it is finished parsing. ** ** Note: during a reduce, the only symbols destroyed are those @@ -259,7 +259,7 @@ static int yy_pop_parser_stack(yyParser *pParser){ return yymajor; } -/* +/* ** Deallocate and destroy a parser. Destructors are all called for ** all stack elements before shutting the parser down. ** @@ -294,7 +294,7 @@ static int yy_find_parser_action( ){ struct yyStateEntry *pState; /* Appropriate entry in the state table */ struct yyActionEntry *pAction; /* Action appropriate for the look-ahead */ - + /* if( pParser->idx<0 ) return YY_NO_ACTION; */ pState = &yyStateTable[pParser->top->stateno]; if( iLookAhead!=YYNOCODE ){ @@ -520,7 +520,7 @@ void Parse( #ifdef YYERRORSYMBOL /* A syntax error has occurred. ** The response to an error depends upon whether or not the - ** grammar defines an error token "ERROR". + ** grammar defines an error token "ERROR". ** ** This is what we do if the grammar does define ERROR: ** |