remove empty dir
[ghc-hetmet.git] / glafp-utils / sgmlverb / sgmlverb.lex
index c605200..812cb84 100644 (file)
 %START  NORM  VERB  VERBENV
 sp                     [ \t]*
 nl                     {sp}\n{sp}
+comment                 \%.*$
 miranda                        ([0-9]+(\-([0-9]+)?)?)?>
 %{
 #define PUSH           states[top++] =
 #define POP            BEGIN states[--top]
 #define yywrap()       1
+#define YY_SKIP_YYWRAP
 %}
 %%
                        int states[256];
@@ -27,6 +29,8 @@ miranda                       ([0-9]+(\-([0-9]+)?)?)?>
                        top = 0;
 <NORM>@@               { printf ("@"); }
 <NORM>@                        { printf ("<tt>"); PUSH NORM;  BEGIN VERB; }
+<NORM>\\%               { printf ("&percnt;"); }
+<NORM>{comment}         { }
 <VERB>@                        { printf ("</tt>");  POP; }
 <VERB>@@               { printf ("@"); }
 <VERB>\>               { printf ("&gt;"); }
@@ -38,11 +42,15 @@ miranda                     ([0-9]+(\-([0-9]+)?)?)?>
 <VERB>\~               { printf ("&tilde;"); }
 <VERB>\^               { printf ("&circ;"); }
 
-<NORM>\<verb\>         { printf ("<verb>"); PUSH NORM; BEGIN VERBENV; }
-<VERBENV>\<\/verb\>    { printf ("</verb>"); POP; }
-<VERBENV>\&\&          { printf ("&"); }
-<VERBENV>\&            { printf ("&ero;"); }
-<VERBENV>\<\/          { printf ("&etago;"); }
+<NORM>\<verb\>          { printf ("<verb>"); PUSH NORM; BEGIN VERBENV; }
+<NORM>\<code\>          { printf ("<code>"); PUSH NORM; BEGIN VERBENV; }
+<NORM>\\begin\{code\}   { printf ("<code>"); PUSH NORM; BEGIN VERBENV; }
+<VERBENV>\<\/verb\>     { printf ("</verb>"); POP; }
+<VERBENV>\<\/code\>     { printf ("</code>"); POP; }
+<VERBENV>\<\\end\{code\} { printf ("</code>"); POP; }
+<VERBENV>\&\&           { printf ("&"); }
+<VERBENV>\&             { printf ("&ero;"); }
+<VERBENV>\<\/           { printf ("&etago;"); }
 
 %%
 int