[antlr-interest] Newbie ANTLR C++
tmiceli at sympatico.ca
Wed Oct 6 15:58:02 PDT 2004
>But at any rate, my question is to know how I would take each token I
>scan and put it into an array. My problem is is that
>getText() returns a string, and in C/C++ there's no string datatype.
Wrong, there is a 'string' type that is part of the STL (standard template
library) that should come with your C++ compiler.
> How do I get around this problem?
std::string tokenText = token->getText();
If you want to store token text in an array, it is better to use a vector
// Definition of the vector of strings object std::vector< std::string >
// Add a token text string at the end of the vector tokenTexts.push_back(
For more take the time to read a good C++ manual.
Yahoo! Groups Links
<*> To visit your group on the web, go to:
<*> To unsubscribe from this group, send an email to:
antlr-interest-unsubscribe at yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
More information about the antlr-interest