yast2-core
Parser.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | |
3 | __ __ ____ _____ ____ |
4 | \ \ / /_ _/ ___|_ _|___ \ |
5 | \ V / _` \___ \ | | __) | |
6 | | | (_| |___) || | / __/ |
7 | |_|\__,_|____/ |_| |_____| |
8 | |
9 | core system |
10 | (C) SuSE GmbH |
11 \----------------------------------------------------------------------/
12 
13  File: Parser.h
14 
15  Author: Mathias Kettner <kettner@suse.de>
16  Maintainer: Klaus Kaempf <kkaempf@suse.de>
17 
18 /-*/
19 /*
20  * YCP interface to the bison generated parser
21  */
22 
23 #ifndef Parser_h
24 #define Parser_h
25 
26 #include <stdio.h>
27 #include <string>
28 
29 #include "ycp/Scanner.h"
30 #include "ycp/YCode.h"
31 
32 class Scanner;
33 class blockstack_t;
34 class scannerstack_t;
35 class switchstack_t;
36 class YBlock;
37 
65 class Parser
66 {
71 
76  bool m_buffered;
77 
82  bool m_depends;
83 
87  bool m_at_eof;
88 
89 public:
94  YCodePtr m_result;
95 
99  int m_lineno;
100 
106 
112 
117 
122 
127 
131  YBlockPtr m_current_block;
132 
137 
141  void init ();
142 
143 public:
148  Parser();
149 
156  Parser(FILE *file, const char *filename=0);
157 
161  Parser(const char *buf);
162 
169  Parser(int fd, const char *filename=0);
170 
174  ~Parser();
175 
188  YCodePtr parse(SymbolTable *gTable = 0, SymbolTable *lTable = 0);
189 
193  Scanner *scanner ();
194 
199  void setScanner (Scanner *);
200 
206  bool atEOF ();
207 
214  void setInput(FILE *file, const char *filename=0);
215 
219  void setInput(const char *buf);
220 
227  void setInput(int fd, const char *filename = 0);
228 
233  void setBuffered();
234 
238  void setDepends();
239 
243  bool depends() const;
244 };
245 
246 #endif // Parser_h

Generated on a sunny day for yast2-core by doxygen 1.8.2