added Token::m_type/setType()/getType(); changed Token::process() to accept a const reference to a Matches; updated build test

This commit is contained in:
Josh Holtrop committed 2010-05-21 10:22:37 -04:00
1 parent 5219989f2a
commit 3a3dc4074b
5 files changed
+35 -21

No files matched your search

+7 -4
View File
@@ -6,11 +6,11 @@ OR or
NOT not
LPAREN \(
RPAREN \)
WS \s+ %{
cout << "Hi there WS!!!!!" << endl;
WS \s+
EQUALS = %{ cout << "Saw '='" << endl; %}
IDENTIFIER [a-zA-Z_][a-zA-Z_0-9]* %{
cout << "Identify: '" << matches[0] << "'" << endl;
%}
EQUALS =
IDENTIFIER [a-zA-Z_][a-zA-Z_0-9]*
DEC_INT [1-9]\d*\b
${
@@ -18,13 +18,16 @@ ${
$}
%{
sscanf("%lld", matches[1].c_str(), &value);
cout << "value: " << value << endl;
%}
HEX_INT 0x([0-9a-fA-F]+)\b ${ uint64_t value; $} %{
sscanf("%llx", matches[1].c_str(), &value);
cout << "value: " << value << endl;
%}
OCT_INT 0([0-7]*)\b
BIN_INT 0b([01]+)\b
[rules]
+2 -1
View File
@@ -10,7 +10,8 @@ int main(int argc, char * argv[])
{
Parser p;
stringstream t(string(
"hi there (one and two and three and four) or (two = nine)"
"hi there (one and two and three and four) or (two = nine)\n"
"0x42 12345 0 011 0b0011\n"
));
p.parse(t);
}