]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/m2/gm2-compiler/M2Reserved.def
Update copyright years.
[thirdparty/gcc.git] / gcc / m2 / gm2-compiler / M2Reserved.def
1 (* M2Reserved.def determines is a token is a reserved word.
2
3 Copyright (C) 2001-2023 Free Software Foundation, Inc.
4 Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
5
6 This file is part of GNU Modula-2.
7
8 GNU Modula-2 is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3, or (at your option)
11 any later version.
12
13 GNU Modula-2 is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with GNU Modula-2; see the file COPYING3. If not see
20 <http://www.gnu.org/licenses/>. *)
21
22 DEFINITION MODULE M2Reserved ;
23
24 (*
25 Author : Gaius Mulley
26 Title : M2Reserved
27 Date : 15/5/87
28 Description: implements a procedure to determine if a symbol is a
29 Modula-2 reserved word and provides conversion between
30 toktype and the equivalent stringed, Name.
31 *)
32
33 FROM NameKey IMPORT Name ;
34
35 EXPORT QUALIFIED IsReserved, tokToTok,
36
37 NulTok, PlusTok, MinusTok, TimesTok, DivideTok, BecomesTok,
38 AmbersandTok, PeriodTok, CommaTok, SemiColonTok, LParaTok,
39 LSBraTok, LCBraTok, UpArrowTok, SingleQuoteTok, EqualTok,
40 HashTok, LessTok, GreaterTok, LessGreaterTok, LessEqualTok,
41 GreaterEqualTok, PeriodPeriodTok, ColonTok, RParaTok,
42 RSBraTok, RCBraTok, BarTok, DoubleQuotesTok,
43
44 AndTok, ArrayTok, BeginTok, ByTok, CaseTok, ConstTok,
45 DefinitionTok, DivTok, DoTok, ElseTok, ElsifTok, EndTok,
46 ExceptTok,
47 ExitTok, ExportTok, FinallyTok, ForTok, FromTok, IfTok,
48 ImplementationTok, ImportTok, InTok, LoopTok, ModTok,
49 ModuleTok, NotTok, OfTok, OrTok,
50 PackedSetTok, PointerTok, ProcedureTok,
51 QualifiedTok, UnQualifiedTok, RecordTok, RetryTok,
52 RemTok, RepeatTok,
53 ReturnTok, SetTok, ThenTok, ToTok, TypeTok, UntilTok, VarTok,
54 WhileTok, WithTok,
55
56 (* additional tokens which extend PIM Modula-2 slightly *)
57 EofTok, AsmTok, VolatileTok, DateTok, LineTok, FileTok,
58 AttributeTok, BuiltinTok, InlineTok,
59 toktype ;
60
61 TYPE
62 toktype = (eoftok, plustok, minustok, timestok, dividetok,
63 becomestok, ambersandtok, periodtok, commatok,
64 semicolontok, lparatok, rparatok, lsbratok, rsbratok,
65 lcbratok, rcbratok, uparrowtok, singlequotetok,
66 equaltok, hashtok, lesstok, greatertok, lessgreatertok,
67 lessequaltok, greaterequaltok,
68 ldirectivetok, rdirectivetok,
69 periodperiodtok,
70 colontok, doublequotestok, bartok, andtok,
71 arraytok, begintok, bytok, casetok, consttok,
72 definitiontok, divtok, dotok, elsetok, elsiftok,
73 endtok, excepttok, exittok, exporttok, finallytok,
74 fortok, fromtok, iftok, implementationtok,
75 importtok, intok, looptok, modtok,
76 moduletok, nottok, oftok, ortok,
77 packedsettok, pointertok, proceduretok,
78 qualifiedtok, unqualifiedtok,
79 recordtok, remtok, repeattok, retrytok, returntok,
80 settok, thentok,
81 totok, typetok, untiltok, vartok, whiletok, withtok,
82 asmtok, volatiletok, periodperiodperiodtok,
83 datetok, linetok, filetok,
84 attributetok, builtintok, inlinetok,
85 integertok, identtok, realtok, stringtok,
86 virtualrangetok) ;
87
88 VAR
89 NulTok, PlusTok, MinusTok, TimesTok, DivideTok, BecomesTok,
90 AmbersandTok, PeriodTok, CommaTok, SemiColonTok, LParaTok,
91 LSBraTok, LCBraTok, UpArrowTok, SingleQuoteTok, EqualTok,
92 HashTok, LessTok, GreaterTok, LessGreaterTok, LessEqualTok,
93 GreaterEqualTok, LDirectiveTok, RDirectiveTok,
94 PeriodPeriodTok, ColonTok, RParaTok,
95 RSBraTok, RCBraTok, BarTok, DoubleQuotesTok,
96
97 AndTok, ArrayTok, BeginTok, ByTok, CaseTok, ConstTok,
98 DefinitionTok, DivTok, DoTok, ElseTok, ElsifTok, EndTok,
99 ExceptTok, ExitTok, ExportTok, FinallyTok, ForTok, FromTok,
100 IfTok, ImplementationTok, ImportTok, InTok, LoopTok, ModTok,
101 ModuleTok, NotTok, OfTok, OrTok,
102 PackedSetTok, PointerTok, ProcedureTok,
103 QualifiedTok, UnQualifiedTok, RecordTok, RemTok, RepeatTok,
104 RetryTok, ReturnTok, SetTok, ThenTok, ToTok, TypeTok,
105 UntilTok, VarTok, WhileTok, WithTok,
106
107 EofTok, AsmTok, VolatileTok,
108 DateTok, LineTok, FileTok,
109 AttributeTok, BuiltinTok, InlineTok: Name ;
110
111
112 (*
113 IsReserved - returns TRUE if the symbol, Name, is a reserved word.
114 If TRUE it also sets tok to the appropriate enumerated
115 value.
116 *)
117
118 PROCEDURE IsReserved (n: Name; VAR tok: toktype) : BOOLEAN ;
119
120
121 (*
122 tokToTok - returns a Tok given the enumerated variable, t.
123 *)
124
125 PROCEDURE tokToTok (t: toktype) : Name ;
126
127
128 END M2Reserved.