src/Tools/8bit/c-sources/a2isa/lex.x
author wenzelm
Thu, 17 Aug 2000 10:42:57 +0200
changeset 9632 1c13360689cb
parent 4168 d158fdc5a075
permissions -rw-r--r--
*** empty log message ***
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1826
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
     1
/*  Title:      Tools/8bit/c-sources/a2isa/lex.x
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
     2
    ID:         $Id$
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
     3
    Author:     David von Oheimb
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
     4
    Copyright   1996 TU Muenchen
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
     5
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
     6
Isabelle ASCII to 8bit converter
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
     7
definitions for the lexical analyzer
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
     8
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
     9
WARNING: the translations should be consistent with the configuration in
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    10
         8bit/config/conv-tables.inp
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    11
*/
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    12
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    13
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    14
%{
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    15
extern FILE *finput, *foutput;
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    16
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    17
void put(char *s)
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    18
{
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    19
  while(*s)
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    20
  {
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    21
    fputc(*s++, yyout);
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    22
  }
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    23
}       
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    24
%}
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    25
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    26
%option 8bit
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    27
%option yylineno
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    28
%option noyywrap
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    29
%x STRING
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    30
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    31
%%
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    32
  yyin  = finput;
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    33
  yyout = foutput;
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    34
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    35
\"			{ ECHO; BEGIN(STRING); }
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    36
[^\"]*			{ ECHO; }
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    37
<STRING>\"		{ ECHO; BEGIN(INITIAL); }
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    38
<STRING>\\[ \t]*\n[ \t]*\\	{ ECHO; }
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    39
<STRING>\n		{ ECHO; fprintf(stderr, 
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    40
			  	"WARNING: line %d ends inside string\n", 
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    41
				yylineno-1); }
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    42
<STRING><<EOF>>		{ 	fprintf(stderr, 
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    43
			  	"WARNING: EOF inside string\n"); 
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    44
				yyterminate(); }
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    45
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    46
<STRING>{
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    47
   /* Pure */
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    48
!!		put("Ä");
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    49
\[\|		put("Ë");
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    50
\|\]		put("Ì");
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    51
==>		put("êë");
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    52
==		put("Ú");
4168
d158fdc5a075 added ax2isa
oheimb
parents: 1826
diff changeset
    53
=>		put("ë");
d158fdc5a075 added ax2isa
oheimb
parents: 1826
diff changeset
    54
::		put("å");
d158fdc5a075 added ax2isa
oheimb
parents: 1826
diff changeset
    55
'a		put("ª");
d158fdc5a075 added ax2isa
oheimb
parents: 1826
diff changeset
    56
'b		put("«");
d158fdc5a075 added ax2isa
oheimb
parents: 1826
diff changeset
    57
'c		put("¬");
d158fdc5a075 added ax2isa
oheimb
parents: 1826
diff changeset
    58
'r		put("¸");
d158fdc5a075 added ax2isa
oheimb
parents: 1826
diff changeset
    59
's		put("¹");
d158fdc5a075 added ax2isa
oheimb
parents: 1826
diff changeset
    60
't		put("º");
1826
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    61
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    62
   /* HOL */
4168
d158fdc5a075 added ax2isa
oheimb
parents: 1826
diff changeset
    63
\ \*\ 		put(" ò ");
d158fdc5a075 added ax2isa
oheimb
parents: 1826
diff changeset
    64
@[ A-Za-z]	{ *yytext='®'; put(yytext); }
1826
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    65
\ &\ 		put(" À ");
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    66
\ \|\ 		put(" Á ");
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    67
~\ 		put("¿ ");
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    68
-->		put("çè");
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    69
~=		put("Û");
4168
d158fdc5a075 added ax2isa
oheimb
parents: 1826
diff changeset
    70
\%[ A-Za-z]	{ *yytext='³'; put(yytext); }
1826
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    71
EX!		put("Ã!");
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    72
\?!		put("Ã!");
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    73
EX\ 		put("Ã");
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    74
\?\ 		put("Ã");
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    75
ALL\ 		put("Â");
4168
d158fdc5a075 added ax2isa
oheimb
parents: 1826
diff changeset
    76
![ A-Za-z]	{ *yytext='Â'; put(yytext); }
1826
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    77
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    78
   /* Set */
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    79
~:		put("ñ");
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    80
:		put("Î");
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    81
  /*
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    82
  > "{}"		"\mbox{$\emptyset$}"
4168
d158fdc5a075 added ax2isa
oheimb
parents: 1826
diff changeset
    83
# > "<="		"\mbox{$\subseteq$}"
1826
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    84
  */
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    85
\ Int\ 		put("Ð");
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    86
\ Un\ 		put("Ñ");
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    87
Inter\ 		put("Ò");
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    88
Union\ 		put("Ó");
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    89
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    90
   /* Nat */
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    91
LEAST\ 		put("´");
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    92
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    93
   /* HOLCF */
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    94
->		put("è");
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    95
\*\*		put("õ");
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    96
\+\+		put("ó");
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
    97
4168
d158fdc5a075 added ax2isa
oheimb
parents: 1826
diff changeset
    98
\<\<\|		put("<<|");
d158fdc5a075 added ax2isa
oheimb
parents: 1826
diff changeset
    99
\<\|		put("<|");
1826
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   100
\<\<		put("Ý");
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   101
LAM\ 		put("¤");
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   102
lub\ 		put("×");
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   103
UU		put("Ø");
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   104
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   105
  /* misc */
4168
d158fdc5a075 added ax2isa
oheimb
parents: 1826
diff changeset
   106
\|-put("É");
d158fdc5a075 added ax2isa
oheimb
parents: 1826
diff changeset
   107
\|=		put("Ê");
d158fdc5a075 added ax2isa
oheimb
parents: 1826
diff changeset
   108
1826
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   109
  /*
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   110
  >  "\Gamma\ "		"\mbox{$\Gamma$}" 
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   111
  >  "\Delta\ "		"\mbox{$\Delta$}" 
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   112
  >  "\Theta\ "		"\mbox{$\Theta$}" 
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   113
  >  "\Pi\ "		"\mbox{$\Pi$}" 
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   114
  >  "\Sigma\ "		"\mbox{$\Sigma$}" 
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   115
  >  "\Phi\ "		"\mbox{$\Phi$}" 
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   116
  >  "\Psi\ "		"\mbox{$\Psi$}" 
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   117
  >  "\Omega\ "		"\mbox{$\Omega$}" 
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   118
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   119
  >  "\delta\ "		"\mbox{$\delta$}" 
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   120
  >  "\epsilon\ "	"\mbox{$\varepsilon$}" 
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   121
  >  "\zeta\ "		"\mbox{$\zeta$}" 
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   122
  >  "\eta\ "		"\mbox{$\eta$}" 
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   123
  >  "\theta\ "		"\mbox{$\vartheta$}" 
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   124
  >  "\kappa\ "		"\mbox{$\kappa$}" 
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   125
  >  "\mu\ "		"\mbox{$\mu$}" 
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   126
  >  "\nu\ "		"\mbox{$\nu$}" 
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   127
  >  "\xi\ "		"\mbox{$\xi$}" 
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   128
  >  "\pi\ "		"\mbox{$\pi$}" 
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   129
  >  "\phi\ "		"\mbox{$\varphi$}" 
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   130
  >  "\chi\ "		"\mbox{$\chi$}" 
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   131
  >  "\psi\ "		"\mbox{$\psi$}" 
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   132
  >  "\omega\ "		"\mbox{$\omega$}" 
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   133
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   134
  >  "\lceil\ "		"\mbox{$\lceil$}" 
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   135
  >  "\rceil\ "		"\mbox{$\rceil$}" 
4168
d158fdc5a075 added ax2isa
oheimb
parents: 1826
diff changeset
   136
  >  "\lfloor\ "	"\mbox{$\lfloor$}" 
d158fdc5a075 added ax2isa
oheimb
parents: 1826
diff changeset
   137
  >  "\rfloor\ "	"\mbox{$\rfloor$}" 
1826
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   138
  >  "\sqcap\ "		"\mbox{$\sqcap$}" 
4168
d158fdc5a075 added ax2isa
oheimb
parents: 1826
diff changeset
   139
  >  "\sqcup\ "		"\mbox{$\sqcup$}"
d158fdc5a075 added ax2isa
oheimb
parents: 1826
diff changeset
   140
  >  "\cdot\ "		"\mbox{$\cdot$}"
1826
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   141
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   142
glb\ 		put("Ö");
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   143
===		put("Ù");
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   144
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   145
  /*
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   146
  >  "\sqsubset\ "	"\mbox{$\sqsubset$}" 
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   147
  >  "\prec\ "		"\mbox{$\prec$}" 
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   148
  >  "\preceq\ "	"\mbox{$\preceq$}" 
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   149
  >  "\Succ\ "		"\mbox{$\succ$}" 
4168
d158fdc5a075 added ax2isa
oheimb
parents: 1826
diff changeset
   150
  >  "\approx\ "	"\mbox{$\approx$}" 
1826
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   151
  >  "\sim\ "		"\mbox{$\sim$}" 
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   152
  >  "\simeq\ "		"\mbox{$\simeq$}" 
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   153
  >  "\le\ "		"\mbox{$\le$}" 
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   154
  >  "\ge\ "		"\mbox{$\ge$}" 
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   155
  */
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   156
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   157
\<==		put("éê");
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   158
\<=>		put("éë");
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   159
\<--		put("æç");
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   160
\<->		put("æè");
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   161
\<-		put("æ");
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   162
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   163
  /*
4168
d158fdc5a075 added ax2isa
oheimb
parents: 1826
diff changeset
   164
  >  "\frown\ "		"\mbox{$\frown$}" 
d158fdc5a075 added ax2isa
oheimb
parents: 1826
diff changeset
   165
  >  "\mapsto\ "	"\mbox{$\mapsto$}" 
1826
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   166
  >  "\leadsto\ "	"\mbox{$\leadsto$}" 
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   167
  >  "\uparrow\ "	"\mbox{$\uparrow$}" 
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   168
  >  "\downarrow\ "	"\mbox{$\downarrow$}" 
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   169
4168
d158fdc5a075 added ax2isa
oheimb
parents: 1826
diff changeset
   170
  >  "\ominus\ "	"\mbox{$\varominus$}" 
d158fdc5a075 added ax2isa
oheimb
parents: 1826
diff changeset
   171
  >  "\oslash\ "	"\mbox{$\varoslash$}" 
d158fdc5a075 added ax2isa
oheimb
parents: 1826
diff changeset
   172
  >  "\subset\ "	"\mbox{$\subset$}" 
1826
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   173
  >  "\infty\ "		"\mbox{$\infty$}" 
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   174
  >  "\Box\ "		"\mbox{$\Box$}" 
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   175
  >  "\Diamond\ "	"\mbox{$\Diamond$}" 
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   176
  >  "\circ\ "		"\mbox{$\circ$}" 
4168
d158fdc5a075 added ax2isa
oheimb
parents: 1826
diff changeset
   177
  >  "\bullet\ "	"\mbox{$\bullet$}" 
1826
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   178
  >  "||"		"\mbox{$\parallel$}" 
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   179
  >  "\tick\ "		"\mbox{$\surd$}" 
4168
d158fdc5a075 added ax2isa
oheimb
parents: 1826
diff changeset
   180
  >  "\filter\ "	"\mbox{\copyright}"
1826
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   181
  */
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   182
}
2a2c0dbeb4ac Initial revision
oheimb
parents:
diff changeset
   183
%%