1
2
3
4
5
6 [cpp]#include <sng2html/sng2html/ParserFileLexer.hpp>
7 [cpp]#include <sng2html/sng2html/ParserFileTokens.hpp>
8
9 using namespace soulng::lexer;
10 using namespace ParserFileTokens;
11
12 parser ParserIdentifierParser
13 {
14 uselexer ParserFileLexer;
15
16 CppIdentifier : std::u32string
17 ::= ID{ return lexer.GetMatch(span); }
18 ;
19
20 QualifiedCppId(var Span s) : std::u32string
21 ::= (empty{ s = span; } COLONCOLON? ID{ s.end = span.end; } (COLONCOLON ID{ s.end = span.end; })*){ return lexer.GetMatch(s); }
22 ;
23
24 ruleinfo
25 {
26 (CppIdentifier, "C++ identifier"), (QualifiedCppId, "Qualified C++ identifier")
27 }
28 }