]>
git.saurik.com Git - apple/security.git/blob - OSX/libsecurity_codesigning/antlr2/src/LLkParser.cpp
1 /* ANTLR Translator Generator
2 * Project led by Terence Parr at http://www.jGuru.com
3 * Software rights: http://www.antlr.org/license.html
5 * $Id: //depot/code/org.antlr/release/antlr-2.7.7/lib/cpp/src/LLkParser.cpp#2 $
8 #include "antlr/LLkParser.hpp"
11 #ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
15 ANTLR_USING_NAMESPACE(std
)
20 * @see antlr.TokenBuffer
21 * @see antlr.LL1Parser
26 LLkParser::LLkParser(const ParserSharedInputState
& state
, int k_
)
27 : Parser(state
), k(k_
)
31 LLkParser::LLkParser(TokenBuffer
& tokenBuf
, int k_
)
32 : Parser(tokenBuf
), k(k_
)
36 LLkParser::LLkParser(TokenStream
& lexer
, int k_
)
37 : Parser(new TokenBuffer(lexer
)), k(k_
)
41 void LLkParser::trace(const char* ee
, const char* rname
)
45 printf("%s", ((string
)ee
+ rname
+ ((inputState
->guessing
>0)?"; [guessing]":"; ")).c_str());
47 for (int i
= 1; i
<= k
; i
++)
52 printf("LA(%d)==", i
);
57 temp
= LT(i
)->getText().c_str();
59 catch( ANTLRException
& ae
)
62 temp
+= ae
.toString();
65 printf("%s", temp
.c_str());
71 void LLkParser::traceIn(const char* rname
)
77 void LLkParser::traceOut(const char* rname
)
83 #ifdef ANTLR_CXX_SUPPORTS_NAMESPACE