Author: kjs
Date: Wed Mar 28 02:54:19 2007
New Revision: 17811
Modified:
trunk/compilers/pirc/src/pirlexer.c
trunk/compilers/pirc/src/pirlexer.h
trunk/compilers/pirc/src/pirout.c
trunk/compilers/pirc/src/pirparser.c
Log:
compilers/pirc:
* removed warning on const qualifier
* renamed read_token to next_token (removing old next_token)
Modified: trunk/compilers/pirc/src/pirlexer.c
==============================================================================
--- trunk/compilers/pirc/src/pirlexer.c (original)
+++ trunk/compilers/pirc/src/pirlexer.c Wed Mar 28 02:54:19 2007
@@ -295,7 +295,7 @@
*/
char * const
-get_current_token(lexer_state *s) {
+get_current_token(lexer_state const *s) {
assert(s->token_chars);
return s->token_chars;
}
@@ -747,8 +747,8 @@
=cut
*/
-static token
-read_token(lexer_state *lexer) {
+token
+next_token(lexer_state *lexer) {
int ok = 1;
int count = 0;
@@ -1556,23 +1556,7 @@
}
-/*
-
-=item next_token()
-
-Calls read_token() for the next token.
-
-XXX NOTE: There used to be some checks in this function. If this doesn't prove
-to be necessary, we can rename read_token() to next_token().
-=cut
-
-*/
-token
-next_token(lexer_state *lexer) {
- token t = read_token(lexer);
- return t;
-}
/*
Modified: trunk/compilers/pirc/src/pirlexer.h
==============================================================================
--- trunk/compilers/pirc/src/pirlexer.h (original)
+++ trunk/compilers/pirc/src/pirlexer.h Wed Mar 28 02:54:19 2007
@@ -173,7 +173,7 @@
extern void close_include_file(struct lexer_state *lexer);
/* get the characters of the current token */
-extern char * const get_current_token(struct lexer_state *s);
+extern char * const get_current_token(struct lexer_state const *s);
/* print some text from the buffer in the neighbourhood of the current token */
extern void print_error_context(struct lexer_state *s);
Modified: trunk/compilers/pirc/src/pirout.c
==============================================================================
--- trunk/compilers/pirc/src/pirout.c (original)
+++ trunk/compilers/pirc/src/pirout.c Wed Mar 28 02:54:19 2007
@@ -10,7 +10,7 @@
*/
void
pirout(struct parser_state *p) {
- struct lexer_state *l = get_lexer(p);
+ struct lexer_state const *l = get_lexer(p);
token t = get_token(p);
switch (t) {
Modified: trunk/compilers/pirc/src/pirparser.c
==============================================================================
--- trunk/compilers/pirc/src/pirparser.c (original)
+++ trunk/compilers/pirc/src/pirparser.c Wed Mar 28 02:54:19 2007
@@ -2083,12 +2083,6 @@
Skip first token of statements if it's sure that the token has already been
checked by the caller. No need
to match 'goto' again, if it was already checked in compilation_unit().
-=item *
-
-Add a 'token category'. For instance, when parsing a binary operator, you're
just interested if it actually is
-a binary op. The lexer can set the token category to "binop", and set token to
T_PLUS, etc. This prevents
-big switch statements. Also, we still have access to the actual binary
operator (through token), so semantic
-analysis can continue.
=back