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
switchstack_t * m_switch_stack
Definition: Parser.h:121
blockstack_t * m_block_stack
Definition: Parser.h:116
bool m_at_eof
Definition: Parser.h:87
int m_lineno
Definition: Parser.h:99
void setInput(FILE *file, const char *filename=0)
Definition: Parser.cc:89
Definition: YBlock.h:49
void setScanner(Scanner *)
Definition: Parser.cc:149
YCodePtr parse(SymbolTable *gTable=0, SymbolTable *lTable=0)
Definition: Parser.cc:156
Definition: SymbolTable.h:100
void setBuffered()
Definition: Parser.cc:119
~Parser()
Definition: Parser.cc:82
scannerstack_t * m_scanner_stack
Definition: Parser.h:126
stack for switch
Definition: parser.cc:289
int m_parser_errors
Definition: Parser.h:111
Scanner for scanning YCP syntax.
Definition: Scanner.h:76
Parser()
Definition: Parser.cc:36
bool atEOF()
Definition: Parser.cc:135
YBlockPtr m_current_block
Definition: Parser.h:131
stack for scanners
Definition: parser.cc:316
YCodePtr m_result
Definition: Parser.h:94
Scanner * m_scanner
Definition: Parser.h:70
int m_blockstack_depth
Definition: Parser.h:136
stack for blocks
Definition: parser.cc:258
int m_loop_count
Definition: Parser.h:105
bool m_buffered
Definition: Parser.h:76
void setDepends()
Definition: Parser.cc:128
void init()
Definition: Parser.cc:195
bool depends() const
Scanner * scanner()
Definition: Parser.cc:142
YCP language parser.
Definition: Parser.h:65
bool m_depends
Definition: Parser.h:82

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