1
|
1 // parse.h -*- C++ -*- |
|
2 /* |
|
3 |
338
|
4 Copyright (C) 1992, 1993, 1994 John W. Eaton |
1
|
5 |
|
6 This file is part of Octave. |
|
7 |
|
8 Octave is free software; you can redistribute it and/or modify it |
|
9 under the terms of the GNU General Public License as published by the |
|
10 Free Software Foundation; either version 2, or (at your option) any |
|
11 later version. |
|
12 |
|
13 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
16 for more details. |
|
17 |
|
18 You should have received a copy of the GNU General Public License |
|
19 along with Octave; see the file COPYING. If not, write to the Free |
|
20 Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
|
21 |
|
22 */ |
|
23 |
383
|
24 #if !defined (octave_parse_h) |
|
25 #define octave_parse_h 1 |
1
|
26 |
|
27 #include "SLStack.h" |
|
28 |
|
29 extern void discard_until (char c); |
|
30 extern void reset_parser (void); |
|
31 extern int yylex (void); |
|
32 extern int yyparse (void); |
|
33 |
|
34 class tree; |
|
35 class tree_matrix; |
|
36 class tree_identifier; |
|
37 class symbol_table; |
|
38 |
|
39 // Nonzero means we're in the middle of defining a function. |
|
40 extern int defining_func; |
|
41 |
|
42 // Nonzero means we're in the middle of defining a loop. |
|
43 extern int looping; |
|
44 |
|
45 // Nonzero means we're in the middle of defining a conditional expression. |
|
46 extern int iffing; |
|
47 |
|
48 // Nonzero means we need to do some extra lookahead to avoid being |
|
49 // screwed by bogus function syntax. |
|
50 extern int maybe_screwed; |
|
51 |
|
52 // Nonzero means we need to do some extra lookahead to avoid being |
|
53 // screwed by bogus function syntax. |
|
54 extern int maybe_screwed_again; |
|
55 |
|
56 // Temporary symbol table pointer used to cope with bogus function syntax. |
|
57 extern symbol_table *tmp_local_sym_tab; |
|
58 |
|
59 // Stack to hold list of literal matrices. |
|
60 extern SLStack <tree_matrix *> ml; |
|
61 |
|
62 // A nonzero element corresponding to an element of ml means we just |
|
63 // started reading a new matrix. This should probably be part of a |
|
64 // new struct for matrix lists... |
|
65 extern SLStack <int> mlnm; |
|
66 |
|
67 // Nonzero means print parser debugging info (-d). |
|
68 extern int yydebug; |
|
69 |
|
70 // The current input line number. |
|
71 extern int input_line_number; |
|
72 |
|
73 // The column of the current token. |
|
74 extern int current_input_column; |
|
75 |
|
76 #define HELP_BUF_LENGTH 8192 |
|
77 |
338
|
78 // Buffer for help text snagged from function files. |
1
|
79 extern char help_buf [HELP_BUF_LENGTH]; |
|
80 |
|
81 // Nonzero means we're working on a plot command. |
|
82 extern int plotting; |
|
83 |
114
|
84 // Nonzero means we've seen something that means we must be past the |
|
85 // range part of a plot command. |
|
86 extern int past_plot_range; |
|
87 |
1
|
88 // Nonzero means we're looking at the range part of a plot command. |
|
89 extern int in_plot_range; |
|
90 |
|
91 // Nonzero means we're looking at the using part of a plot command. |
|
92 extern int in_plot_using; |
|
93 |
|
94 // Nonzero means we're looking at the style part of a plot command. |
|
95 extern int in_plot_style; |
|
96 |
|
97 #endif |
|
98 |
|
99 /* |
|
100 ;;; Local Variables: *** |
|
101 ;;; mode: C++ *** |
|
102 ;;; page-delimiter: "^/\\*" *** |
|
103 ;;; End: *** |
|
104 */ |