~ubuntu-branches/ubuntu/lucid/fpc/lucid-proposed

« back to all changes in this revision

Viewing changes to fpcsrc/utils/sim_pasc/lisplang.l

  • Committer: Bazaar Package Importer
  • Author(s): Mazen Neifer, Torsten Werner, Mazen Neifer
  • Date: 2008-10-09 23:29:00 UTC
  • mfrom: (4.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20081009232900-553f61m37jkp6upv
Tags: 2.2.2-4
[ Torsten Werner ]
* Update ABI version in fpc-depends automatically.
* Remove empty directories from binary package fpc-source.

[ Mazen Neifer ]
* Removed leading path when calling update-alternatives to remove a Linitian
  error.
* Fixed clean target.
* Improved description of packages. (Closes: #498882)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
%{
 
2
/*      This file is part of the software similarity tester SIM.
 
3
        Written by Dick Grune, Vrije Universiteit, Amsterdam.
 
4
        $Id: lisplang.l,v 2.9 2007/08/29 09:10:33 dick Exp $
 
5
*/
 
6
 
 
7
/*
 
8
        LISP language front end for the similarity tester.
 
9
        Author: Gertjan Akkerman <akkerm@cs.vu.nl>
 
10
        Date:   Thu, 9 Apr 87 11:15:23 MDT
 
11
*/
 
12
 
 
13
#include        "language.h"
 
14
#include        "token.h"
 
15
#include        "lex.h"
 
16
#include        "lang.h"
 
17
 
 
18
/* Language-dependent Code */
 
19
#include        "idf.h"
 
20
 
 
21
static const struct idf reserved[] = {
 
22
        {"append",      NORM('a')},
 
23
        {"append1",     NORM('b')},
 
24
        {"atom",        NORM('t')},
 
25
        {"car",         NORM('h')},
 
26
        {"cdr",         NORM('t')},
 
27
        {"cond",        NORM('c')},
 
28
        {"cons",        NORM('s')},
 
29
        {"defun",       NORM('u')},
 
30
        {"do",          NORM('d')},
 
31
        {"eq",          NORM('e')},
 
32
        {"equal",       NORM('e')},             /* See eq */
 
33
        {"for",         NORM('f')},
 
34
        {"if",          NORM('i')},
 
35
        {"list",        NORM('l')},
 
36
        {"nconc",       NORM('n')},
 
37
        {"rplaca",      NORM('A')},
 
38
        {"rplacd",      NORM('D')}
 
39
};
 
40
 
 
41
/* Token sets for module algollike */
 
42
const TOKEN NonFinals[] = {
 
43
        NORM('('),
 
44
        NORM('['),
 
45
        NOTOKEN
 
46
};
 
47
const TOKEN NonInitials[] = {
 
48
        NORM(')'),
 
49
        NORM(']'),
 
50
        NOTOKEN
 
51
};
 
52
const TOKEN Openers[] = {
 
53
        NORM('('),
 
54
        NORM('['),
 
55
        NOTOKEN
 
56
};
 
57
const TOKEN Closers[] = {
 
58
        NORM(')'),
 
59
        NORM(']'),
 
60
        NOTOKEN
 
61
};
 
62
 
 
63
%}
 
64
 
 
65
%option nounput
 
66
%option never-interactive
 
67
 
 
68
%Start  Comment
 
69
 
 
70
Layout          ([ \t\r\f])
 
71
ASCII95         ([- !"#$%&'()*+,./0-9:;<=>?@A-Z\[\\\]^_`a-z{|}~])
 
72
 
 
73
AnyQuoted       (\\.)
 
74
StrChar         ([^"\n\\]|{AnyQuoted})
 
75
ChrChar         ([^'\\]|{AnyQuoted})
 
76
 
 
77
IdfChar         ([-!#$%&*+,/0-9:;<=>?@A-Z\\^_`a-z{}~])
 
78
 
 
79
EscIdf          (({IdfChar}|\\.)+)
 
80
QuotIdf         ("|"[^\|\n]*"|")
 
81
Idf             ({EscIdf}|{QuotIdf})
 
82
 
 
83
%%
 
84
 
 
85
";".*$  {                               /* comment */
 
86
        }
 
87
 
 
88
\"{StrChar}*\"  {                       /* strings */
 
89
                return_ch('"');
 
90
        }
 
91
 
 
92
{Idf}   {                               /* identifier */
 
93
                return_tk(idf_in_list(yytext, reserved, sizeof reserved, IDF));
 
94
        }
 
95
 
 
96
\n      {                               /* count newlines */
 
97
                return_eol();
 
98
        }
 
99
 
 
100
{Layout}        {                       /* ignore layout */
 
101
        }
 
102
 
 
103
{ASCII95}       {                       /* copy other text */
 
104
                return_ch(yytext[0]);
 
105
        }
 
106
 
 
107
.       {                               /* count non-ASCII chars */
 
108
                lex_non_ascii_cnt++;
 
109
        }
 
110
 
 
111
%%
 
112
 
 
113
/* Language-INdependent Code */
 
114
 
 
115
void
 
116
yystart(void) {
 
117
        BEGIN INITIAL;
 
118
}
 
119
 
 
120
int
 
121
yywrap(void) {
 
122
        return 1;
 
123
}