cvsuser 03/08/12 03:09:29
Modified: languages/imcc ChangeLog imcc.l
languages/imcc/docs macros.pod
Log:
enable macros for PIR parsing mode
Revision Changes Path
1.31 +4 -0 parrot/languages/imcc/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/public/parrot/languages/imcc/ChangeLog,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -w -r1.30 -r1.31
--- ChangeLog 11 Aug 2003 13:52:13 -0000 1.30
+++ ChangeLog 12 Aug 2003 10:09:20 -0000 1.31
@@ -1,3 +1,7 @@
+- 2003-08-12 leo
+
+ * lexer: enable macros for PIR parsing mode
+
- 2003-08-11 leo
* PCC: approaching life analysis for subroutine in/out variables
1.43 +5 -8 parrot/languages/imcc/imcc.l
Index: imcc.l
===================================================================
RCS file: /cvs/public/parrot/languages/imcc/imcc.l,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -w -r1.42 -r1.43
--- imcc.l 2 Aug 2003 08:53:48 -0000 1.42
+++ imcc.l 12 Aug 2003 10:09:20 -0000 1.43
@@ -199,14 +199,10 @@
"!=" return(RELOP_NE);
"**" return(POW);
-<emit>".macro" {
+<emit,INITIAL>".macro" {
return read_macro(valp, interp);
}
-<INITIAL>".macro" {
- fataly (EX_SOFTWARE, "", line, "Macros only allowed in assembly mode");
- }
-
<emit>".constant" {
int c;
char *name;
@@ -244,11 +240,12 @@
include_file(str_dup(yytext + 1));
}
-<emit>{ID}"$:" {
+<emit,INITIAL>{ID}"$:" {
char *label;
if (valp) {
- YYCHOP(); YYCHOP();
+ YYCHOP();
+ YYCHOP();
label = mem_sys_allocate(yyleng+10);
sprintf(label, "%s%d", yytext, frames->label);
@@ -259,7 +256,7 @@
return LABEL;
}
-<emit>{ID}"$" {
+<emit,INITIAL>{ID}"$" {
char *label;
if (valp) {
1.5 +6 -5 parrot/languages/imcc/docs/macros.pod
Index: macros.pod
===================================================================
RCS file: /cvs/public/parrot/languages/imcc/docs/macros.pod,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -w -r1.4 -r1.5
--- macros.pod 7 Jul 2003 21:56:21 -0000 1.4
+++ macros.pod 12 Aug 2003 10:09:29 -0000 1.5
@@ -8,11 +8,12 @@
=head1 DESCRIPTION
-The macro support for IMCC was designed to be a drop in replacement
-for the original F<assemble.pl> macro layer. There for the the macro
-expansion at the moment only works in assembly mode, except for the
-B<.include "file"> feature. Furthermore this documentation is in
-large parts copied literally from there.
+The macro support for IMCC was designed to be a drop in replacement for
+the original F<assemble.pl> macro layer.
+
+One exception is B<.constant> which is PASM mode only. Please use the
+B<.const> directive for PIR mode. Also note that you have to use B<.sym>
+inside macros to define symbols, B<.local> is used for local labels.
The addition of the '.' preface will hopefully make things easier to
parse, inasmuch as everything within an assembler file that needs to