1 #include "ParserLiteralParser.hpp"
  2 #include <soulng/util/Unicode.hpp>
  3 #include <sng2html/sng2html/ParserFileLexer.hpp>
  4 #include <sng2html/sng2html/ParserFileTokens.hpp>
  5 
  6 // this file has been automatically generated from 'D:/work/soulng-project/tools/sng2html/sng2html/ParserLiteralParser.parser' using soulng parser generator spg version 3.0.0
  7 
  8 using namespace soulng::unicode;
  9 using namespace soulng::lexer;
 10 using namespace ParserFileTokens;
 11 
 12 soulng::parser::Match ParserLiteralParser::CppLiteral(ParserFileLexer& lexer)
 13 {
 14     #ifdef SOULNG_PARSER_DEBUG_SUPPORT
 15 
 16 
 17 
 18 
 19 
 20 
 21 
 22     #endif // SOULNG_PARSER_DEBUG_SUPPORT
 23     soulng::parser::Match match(false);
 24     int64_t pos = lexer.GetPos();
 25     soulng::lexer::Span span = lexer.GetSpan();
 26     switch (*lexer)
 27     {
 28         case INTLIT:
 29         {
 30             ++lexer;
 31             {
 32                 {
 33                     #ifdef SOULNG_PARSER_DEBUG_SUPPORT
 34 
 35                     #endif // SOULNG_PARSER_DEBUG_SUPPORT
 36                     return soulng::parser::Match(truenew soulng::cppcode::Literal(lexer.GetMatch(span)));
 37                 }
 38             }
 39             break;
 40         }
 41         case FLOATINGLIT:
 42         {
 43             ++lexer;
 44             {
 45                 {
 46                     #ifdef SOULNG_PARSER_DEBUG_SUPPORT
 47 
 48                     #endif // SOULNG_PARSER_DEBUG_SUPPORT
 49                     return soulng::parser::Match(truenew soulng::cppcode::Literal(lexer.GetMatch(span)));
 50                 }
 51             }
 52             break;
 53         }
 54         case CHARLIT:
 55         {
 56             ++lexer;
 57             {
 58                 {
 59                     #ifdef SOULNG_PARSER_DEBUG_SUPPORT
 60 
 61                     #endif // SOULNG_PARSER_DEBUG_SUPPORT
 62                     return soulng::parser::Match(truenew soulng::cppcode::Literal(lexer.GetMatch(span)));
 63                 }
 64             }
 65             break;
 66         }
 67         case STRINGLIT:
 68         {
 69             ++lexer;
 70             {
 71                 {
 72                     #ifdef SOULNG_PARSER_DEBUG_SUPPORT
 73 
 74                     #endif // SOULNG_PARSER_DEBUG_SUPPORT
 75                     return soulng::parser::Match(truenew soulng::cppcode::Literal(lexer.GetMatch(span)));
 76                 }
 77             }
 78             break;
 79         }
 80         case TRUE:
 81         {
 82             ++lexer;
 83             {
 84                 {
 85                     #ifdef SOULNG_PARSER_DEBUG_SUPPORT
 86 
 87                     #endif // SOULNG_PARSER_DEBUG_SUPPORT
 88                     return soulng::parser::Match(truenew soulng::cppcode::Literal(lexer.GetMatch(span)));
 89                 }
 90             }
 91             break;
 92         }
 93         case FALSE:
 94         {
 95             ++lexer;
 96             {
 97                 {
 98                     #ifdef SOULNG_PARSER_DEBUG_SUPPORT
 99 
100                     #endif // SOULNG_PARSER_DEBUG_SUPPORT
101                     return soulng::parser::Match(truenew soulng::cppcode::Literal(lexer.GetMatch(span)));
102                 }
103             }
104             break;
105         }
106         case NULLPTR:
107         {
108             ++lexer;
109             {
110                 {
111                     #ifdef SOULNG_PARSER_DEBUG_SUPPORT
112 
113                     #endif // SOULNG_PARSER_DEBUG_SUPPORT
114                     return soulng::parser::Match(truenew soulng::cppcode::Literal(lexer.GetMatch(span)));
115                 }
116             }
117             break;
118         }
119     }
120     #ifdef SOULNG_PARSER_DEBUG_SUPPORT
121 
122 
123 
124 
125 
126     #endif // SOULNG_PARSER_DEBUG_SUPPORT
127     if (!match.hit)
128     {
129         match.value = nullptr;
130     }
131     return match;
132 }