aboutsummaryrefslogtreecommitdiff
path: root/src/parser.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/parser.h')
-rw-r--r--src/parser.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/parser.h b/src/parser.h
index e720e54..5b5d4a8 100644
--- a/src/parser.h
+++ b/src/parser.h
@@ -62,7 +62,7 @@ namespace Bu
62 State( Type eType, int iIndex ); 62 State( Type eType, int iIndex );
63 virtual ~State(); 63 virtual ~State();
64 64
65 private: 65 //private:
66 Type eType; 66 Type eType;
67 int iIndex; 67 int iIndex;
68 }; 68 };
@@ -76,10 +76,12 @@ namespace Bu
76 virtual ~NonTerminal(); 76 virtual ~NonTerminal();
77 77
78 void addProduction( Production p ); 78 void addProduction( Production p );
79 void setCanSkip();
79 80
80 private: 81// private:
81 typedef Bu::List<Production> ProductionList; 82 typedef Bu::List<Production> ProductionList;
82 ProductionList lProduction; 83 ProductionList lProduction;
84 bool bCanSkip;
83 }; 85 };
84 86
85 int addNonTerminal( const Bu::FString &sName, NonTerminal &nt ); 87 int addNonTerminal( const Bu::FString &sName, NonTerminal &nt );
@@ -93,6 +95,10 @@ namespace Bu
93 int getReductionId( const Bu::FString &sName ); 95 int getReductionId( const Bu::FString &sName );
94 96
95 private: 97 private:
98 bool selectProduction( int iNt, Lexer::Token *ptCur );
99 void advanceState();
100
101 private:
96 typedef Bu::List<Lexer *> LexerStack; 102 typedef Bu::List<Lexer *> LexerStack;
97 typedef Bu::List<Lexer::Token *> TokenStack; 103 typedef Bu::List<Lexer::Token *> TokenStack;
98 typedef Bu::List<Production::const_iterator> StateStack; 104 typedef Bu::List<Production::const_iterator> StateStack;
@@ -109,6 +115,9 @@ namespace Bu
109 NameIndexHash hNonTerminalName; 115 NameIndexHash hNonTerminalName;
110 int iRootNonTerminal; 116 int iRootNonTerminal;
111 }; 117 };
118Bu::Formatter &operator<<( Bu::Formatter &f, Bu::Parser::State::Type t );
119Bu::Formatter &operator<<( Bu::Formatter &f, const Bu::Parser::State &s );
112}; 120};
113 121
122
114#endif 123#endif