]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/m2/gm2-compiler/cflex.def
Update copyright years.
[thirdparty/gcc.git] / gcc / m2 / gm2-compiler / cflex.def
CommitLineData
1eee94d3
GM
1(* cflex.def provides a Modula-2 definition module for C lexical analysis.
2
a945c346 3Copyright (C) 2003-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/>. *)
21
22DEFINITION MODULE cflex ;
23
24(*
25 Title : clex
26 Author : Gaius Mulley
27 System : GNU Modula-2
28 Date : Thu Jan 23 12:39:36 2003
29 Revision : $Version$
30 Description: provides a Modula-2 definition module for C lexical analysis.
31*)
32
33FROM SYSTEM IMPORT ADDRESS ;
34EXPORT QUALIFIED GetToken, AdvanceToken, CError, OpenSource, CloseSource, GetLineNo,
35 ParsingOn, SetSearchPath, AddTypeDef ;
36
37
38(*
39 CloseSource - provided for semantic sugar
40*)
41
42PROCEDURE CloseSource ;
43
44
45(*
46 OpenSource - returns TRUE if file, s, can be opened and
47 all tokens are taken from this file.
48*)
49
50PROCEDURE OpenSource (s: ADDRESS) : BOOLEAN ;
51
52
53(*
54 GetToken - returns the ADDRESS of the next token.
55*)
56
57PROCEDURE GetToken () : ADDRESS ;
58
59
60(*
61 AdvanceToken - move onto the next token.
62*)
63
64PROCEDURE AdvanceToken ;
65
66
67(*
68 GetLineNo - returns the current line number.
69*)
70
71PROCEDURE GetLineNo () : CARDINAL ;
72
73
74(*
75 CError - displays the error message, s, after the code line and pointer
76 to the erroneous token.
77*)
78
79PROCEDURE CError (s: ADDRESS) ;
80
81
82(*
83 ParsingOn - if t is FALSE then the lexical analysis will
84 consume all lines except when a line is one of
85 '#endif' or '#else' or '#if' or '#ifdef'
86*)
87
88PROCEDURE ParsingOn (t: BOOLEAN) ;
89
90
91(*
92 SetSearchPath - reassigns the search path to newPath.
93*)
94
95PROCEDURE SetSearchPath (newPath: ADDRESS) ;
96
97
98(*
99 AddTypeDef - adds the string, a, to the list of typedefs.
100*)
101
102PROCEDURE AddTypeDef (a: ADDRESS) ;
103
104
105END cflex.