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/YCode.h"
30 
31 class Scanner;
32 struct blockstack_t;
33 struct scannerstack_t;
34 struct switchstack_t;
35 class YBlock;
36 
64 class Parser
65 {
70 
75  bool m_buffered;
76 
81  bool m_depends;
82 
86  bool m_at_eof;
87 
88 public:
93  YCodePtr m_result;
94 
98  int m_lineno;
99 
105 
111 
116 
121 
126 
130  YBlockPtr m_current_block;
131 
136 
140  void init ();
141 
142 public:
147  Parser();
148 
155  Parser(FILE *file, const char *filename=0);
156 
160  Parser(const char *buf);
161 
168  Parser(int fd, const char *filename=0);
169 
173  ~Parser();
174 
187  YCodePtr parse(SymbolTable *gTable = 0, SymbolTable *lTable = 0);
188 
192  Scanner *scanner ();
193 
198  void setScanner (Scanner *);
199 
205  bool atEOF ();
206 
213  void setInput(FILE *file, const char *filename=0);
214 
218  void setInput(const char *buf);
219 
226  void setInput(int fd, const char *filename = 0);
227 
232  void setBuffered();
233 
237  void setDepends();
238 
242  bool depends() const;
243 };
244 
245 #endif // Parser_h
switchstack_t * m_switch_stack
Definition: Parser.h:120
blockstack_t * m_block_stack
Definition: Parser.h:115
bool m_at_eof
Definition: Parser.h:86
int m_lineno
Definition: Parser.h:98
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:125
stack for switch
Definition: parser.cc:289
int m_parser_errors
Definition: Parser.h:110
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:130
stack for scanners
Definition: parser.cc:316
YCodePtr m_result
Definition: Parser.h:93
Scanner * m_scanner
Definition: Parser.h:69
int m_blockstack_depth
Definition: Parser.h:135
stack for blocks
Definition: parser.cc:258
int m_loop_count
Definition: Parser.h:104
bool m_buffered
Definition: Parser.h:75
void setDepends()
Definition: Parser.cc:128
Interface specification for modules and all text on a line after a Lines may be continued by ending the line with a The remaining lines should all conform to one of the following are used in the etc modules problems begin When we do not want to break the file
Definition: modules_conf.altern.txt:2
void init()
Definition: Parser.cc:195
bool depends() const
Scanner * scanner()
Definition: Parser.cc:142
YCP language parser.
Definition: Parser.h:64
bool m_depends
Definition: Parser.h:81

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