]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/m2/gm2-compiler/M2Lex.def
Update copyright years.
[thirdparty/gcc.git] / gcc / m2 / gm2-compiler / M2Lex.def
CommitLineData
1eee94d3
GM
1(* M2Lex.def provides a non tokenised lexical analyser.
2
a945c346 3Copyright (C) 2001-2024 Free Software Foundation, Inc.
1eee94d3
GM
4Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
5
6This file is part of GNU Modula-2.
7
8GNU Modula-2 is free software; you can redistribute it and/or modify
9it under the terms of the GNU General Public License as published by
10the Free Software Foundation; either version 3, or (at your option)
11any later version.
12
13GNU Modula-2 is distributed in the hope that it will be useful, but
14WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16General Public License for more details.
17
18You should have received a copy of the GNU General Public License
19along with GNU Modula-2; see the file COPYING3. If not see
20<http://www.gnu.org/licenses/>. *)
21DEFINITION MODULE M2Lex ;
22
23(*
24 Title : M2Lex
25 Author : Gaius Mulley
26 Date : Date: Sat 16-09-1989 Time: 17:54:22.58
27 LastEdit : Date: Sat 16-09-1989 Time: 17:54:22.58
28 System : UNIX (GNU Modula-2)
29 Description: Provides a non tokenised version of M2Lexical.
30 Symbols are distinct MODULA-2 symbols.
31*)
32
33EXPORT QUALIFIED MaxLine,
34 GetSymbol,
35 PutSymbol,
36 CurrentSymbol,
37 LastSymbol,
38 OpenSource,
39 CloseSource,
40 SymIs,
41 IsSym,
42 WriteError ;
43
44CONST
45 MaxLine = 1024 ;
46
47VAR
48 LastSymbol,
49 CurrentSymbol : ARRAY [0..MaxLine] OF CHAR ;
50
51
52(*
53 OpenSource - Attempts to open the source file, a.
54 The success of the operation is returned.
55*)
56
57PROCEDURE OpenSource (a: ARRAY OF CHAR) : BOOLEAN ;
58
59
60(*
61 CloseSource - Closes the current open file.
62*)
63
64PROCEDURE CloseSource ;
65
66
67(*
68 SymIs - if Name is equal to the CurrentSymbol the next Symbol is read
69 and true is returned, otherwise false is returned.
70*)
71
72PROCEDURE SymIs (Name: ARRAY OF CHAR) : BOOLEAN ;
73
74
75(*
76 IsSym - returns the result of the comparison between CurrentSymbol
77 and Name.
78*)
79
80PROCEDURE IsSym (Name: ARRAY OF CHAR) : BOOLEAN ;
81
82
83(*
84 GetSymbol - gets the next Symbol into CurrentSymbol.
85*)
86
87PROCEDURE GetSymbol ;
88
89
90(*
91 PutSymbol - pushes a symbol, Name, back onto the input.
92 GetSymbol will set CurrentSymbol to, Name.
93*)
94
95PROCEDURE PutSymbol (Name: ARRAY OF CHAR) ;
96
97
98(*
99 WriteError - displays the source line and points to the symbol in error.
100 The message, a, is displayed.
101*)
102
103PROCEDURE WriteError (a: ARRAY OF CHAR) ;
104
105
106END M2Lex.