Author: kjs
Date: Wed Jun 13 08:43:26 2007
New Revision: 18969
Modified:
trunk/compilers/pirc/src/pastout.c
trunk/compilers/pirc/src/pirmain.c
trunk/compilers/pirc/src/pirparser.c
Log:
compilers/pirc:
* allow :outer(identifier) and update doc.
* fix line-length codingstd errors in pirmain, pastout.c
Modified: trunk/compilers/pirc/src/pastout.c
==============================================================================
--- trunk/compilers/pirc/src/pastout.c (original)
+++ trunk/compilers/pirc/src/pastout.c Wed Jun 13 08:43:26 2007
@@ -227,7 +227,8 @@
*/
static void
past_expr(struct emit_data *data, char *expr) {
- fprintf(data->file, "%*s[%d] => \"%s\"\n", data->indent, " ",
data->index++, expr); /* fix index */
+ fprintf(data->file, "%*s[%d] => \"%s\"\n", data->indent, " ",
data->index++, expr);
+ /* fix index */
}
/*
Modified: trunk/compilers/pirc/src/pirmain.c
==============================================================================
--- trunk/compilers/pirc/src/pirmain.c (original)
+++ trunk/compilers/pirc/src/pirmain.c Wed Jun 13 08:43:26 2007
@@ -147,7 +147,8 @@
/* just create an empty vtable, the default implementation does
nothing */
vtable = new_pirvtable();
- if (outputfile != NULL) /* if the user did specify an output file,
this doesn't make sense */
+ /* if the user did specify an output file, this doesn't make sense
*/
+ if (outputfile != NULL)
fprintf(stderr, "No output specified: output file will be
ignored\n");
break;
Modified: trunk/compilers/pirc/src/pirparser.c
==============================================================================
--- trunk/compilers/pirc/src/pirparser.c (original)
+++ trunk/compilers/pirc/src/pirparser.c Wed Jun 13 08:43:26 2007
@@ -1371,7 +1371,7 @@
long-invocation -> '.pcc_begin' '\n'
{ '.arg' expression arg_flags }
( '.pcc_call'|'.nci_call') invokable '\n'
- | '.invocant' invocant '\n'
+ | '.invocant' invokable '\n'
'.meth_call' method '\n'
)
{ (local_declaration | '.result' target param_flags '\n')
}
@@ -1957,7 +1957,7 @@
| ':main'
| ':method'
| ':lex'
- | ':outer' '(' STRINGC ')'
+ | ':outer' '(' ( STRINGC | IDENTIFIER ) ')'
| ':vtable' '(' STRINGC ')'
| ':multi' multi-type-list
| ':postcomp'
@@ -1987,6 +1987,15 @@
next(p);
break;
case T_OUTER_FLAG:
+ if (p->curtoken == T_STRING_CONSTANT
+ || p->curtoken == T_IDENTIFIER) {
+ next(p);
+ }
+ else {
+ syntax_error(p, 1, "argument for :outer flag must be"
+ " a string constant or identifier");
+ }
+ break;
case T_VTABLE_FLAG: {
emit_sub_flag(p, p->curtoken); /* emit current flag */
next(p);