]>
git.saurik.com Git - apple/security.git/blob - OSX/libsecurity_codesigning/lib/RequirementLexer.cpp
1 /* $ANTLR 2.7.7 (20121221): "requirements.grammar" -> "RequirementLexer.cpp"$ */
2 #include "RequirementLexer.hpp"
3 #include <antlr/CharBuffer.hpp>
4 #include <antlr/TokenStreamException.hpp>
5 #include <antlr/TokenStreamIOException.hpp>
6 #include <antlr/TokenStreamRecognitionException.hpp>
7 #include <antlr/CharStreamException.hpp>
8 #include <antlr/CharStreamIOException.hpp>
9 #include <antlr/NoViableAltForCharException.hpp>
12 #include "requirement.h"
14 #include "csutilities.h"
15 #include <security_utilities/cfutilities.h>
16 #include <security_utilities/hashing.h>
17 #include <security_cdsa_utilities/cssmdata.h> // OID coding
18 using namespace CodeSigning
;
19 typedef Requirement::Maker Maker
;
21 ANTLR_BEGIN_NAMESPACE(Security_CodeSigning
)
22 RequirementLexer::RequirementLexer(std::istream
& in
)
23 : antlr::CharScanner(new antlr::CharBuffer(in
),true)
28 RequirementLexer::RequirementLexer(antlr::InputBuffer
& ib
)
29 : antlr::CharScanner(ib
,true)
34 RequirementLexer::RequirementLexer(const antlr::LexerSharedInputState
& state
)
35 : antlr::CharScanner(state
,true)
40 void RequirementLexer::initLiterals()
42 literals
["certificate"] = 26;
43 literals
["always"] = 15;
45 literals
["guest"] = 5;
46 literals
["cdhash"] = 20;
47 literals
["entitlement"] = 30;
48 literals
["library"] = 8;
49 literals
["never"] = 17;
50 literals
["cert"] = 27;
51 literals
["plugin"] = 9;
53 literals
["leaf"] = 43;
54 literals
["info"] = 29;
55 literals
["designated"] = 7;
56 literals
["apple"] = 24;
57 literals
["trusted"] = 28;
58 literals
["true"] = 16;
59 literals
["notarized"] = 22;
61 literals
["root"] = 44;
62 literals
["platform"] = 21;
63 literals
["anchor"] = 23;
64 literals
["false"] = 18;
65 literals
["generic"] = 25;
66 literals
["identifier"] = 19;
67 literals
["exists"] = 31;
70 antlr::RefToken
RequirementLexer::nextToken()
72 antlr::RefToken theRetToken
;
74 antlr::RefToken theRetToken
;
75 int _ttype
= antlr::Token::INVALID_TYPE
;
77 try { // for lexical and char stream error handling
79 case 0x22 /* '\"' */ :
82 theRetToken
=_returnToken
;
88 theRetToken
=_returnToken
;
94 theRetToken
=_returnToken
;
100 theRetToken
=_returnToken
;
103 case 0x5b /* '[' */ :
106 theRetToken
=_returnToken
;
109 case 0x5d /* ']' */ :
112 theRetToken
=_returnToken
;
115 case 0x2c /* ',' */ :
118 theRetToken
=_returnToken
;
121 case 0x7e /* '~' */ :
124 theRetToken
=_returnToken
;
127 case 0x2d /* '-' */ :
130 theRetToken
=_returnToken
;
133 case 0x21 /* '!' */ :
136 theRetToken
=_returnToken
;
139 case 0x2a /* '*' */ :
142 theRetToken
=_returnToken
;
145 case 0x9 /* '\t' */ :
146 case 0xa /* '\n' */ :
147 case 0x20 /* ' ' */ :
150 theRetToken
=_returnToken
;
153 case 0x23 /* '#' */ :
156 theRetToken
=_returnToken
;
160 if ((LA(1) == 0x2f /* '/' */ ) && (_tokenSet_0
.member(LA(2)))) {
162 theRetToken
=_returnToken
;
164 else if ((LA(1) == 0x48 /* 'H' */ ) && (LA(2) == 0x22 /* '\"' */ )) {
166 theRetToken
=_returnToken
;
168 else if ((LA(1) == 0x30 /* '0' */ ) && (LA(2) == 0x78 /* 'x' */ )) {
170 theRetToken
=_returnToken
;
172 else if ((LA(1) == 0x3d /* '=' */ ) && (LA(2) == 0x3e /* '>' */ )) {
174 theRetToken
=_returnToken
;
176 else if ((LA(1) == 0x3c /* '<' */ ) && (LA(2) == 0x3d /* '=' */ )) {
178 theRetToken
=_returnToken
;
180 else if ((LA(1) == 0x3e /* '>' */ ) && (LA(2) == 0x3d /* '=' */ )) {
182 theRetToken
=_returnToken
;
184 else if ((LA(1) == 0x3d /* '=' */ ) && (LA(2) == 0x3d /* '=' */ )) {
186 theRetToken
=_returnToken
;
188 else if ((LA(1) == 0x2f /* '/' */ ) && (LA(2) == 0x2a /* '*' */ )) {
190 theRetToken
=_returnToken
;
192 else if ((LA(1) == 0x2f /* '/' */ ) && (LA(2) == 0x2f /* '/' */ )) {
194 theRetToken
=_returnToken
;
196 else if ((_tokenSet_0
.member(LA(1))) && (true)) {
198 theRetToken
=_returnToken
;
200 else if (((LA(1) >= 0x30 /* '0' */ && LA(1) <= 0x39 /* '9' */ )) && (true)) {
202 theRetToken
=_returnToken
;
204 else if ((LA(1) == 0x3c /* '<' */ ) && (true)) {
206 theRetToken
=_returnToken
;
208 else if ((LA(1) == 0x3e /* '>' */ ) && (true)) {
210 theRetToken
=_returnToken
;
212 else if ((LA(1) == 0x3d /* '=' */ ) && (true)) {
214 theRetToken
=_returnToken
;
220 _returnToken
= makeToken(antlr::Token::EOF_TYPE
);
222 else {throw antlr::NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
226 goto tryAgain
; // found SKIP token
228 _ttype
= _returnToken
->getType();
229 _returnToken
->setType(_ttype
);
232 catch (antlr::RecognitionException
& e
) {
233 throw antlr::TokenStreamRecognitionException(e
);
235 catch (antlr::CharStreamIOException
& csie
) {
236 throw antlr::TokenStreamIOException(csie
.io
);
238 catch (antlr::CharStreamException
& cse
) {
239 throw antlr::TokenStreamException(cse
.getMessage());
245 void RequirementLexer::mIDENT(bool _createToken
) {
246 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
248 std::string::size_type _saveIndex
;
252 case 0x41 /* 'A' */ :
253 case 0x42 /* 'B' */ :
254 case 0x43 /* 'C' */ :
255 case 0x44 /* 'D' */ :
256 case 0x45 /* 'E' */ :
257 case 0x46 /* 'F' */ :
258 case 0x47 /* 'G' */ :
259 case 0x48 /* 'H' */ :
260 case 0x49 /* 'I' */ :
261 case 0x4a /* 'J' */ :
262 case 0x4b /* 'K' */ :
263 case 0x4c /* 'L' */ :
264 case 0x4d /* 'M' */ :
265 case 0x4e /* 'N' */ :
266 case 0x4f /* 'O' */ :
267 case 0x50 /* 'P' */ :
268 case 0x51 /* 'Q' */ :
269 case 0x52 /* 'R' */ :
270 case 0x53 /* 'S' */ :
271 case 0x54 /* 'T' */ :
272 case 0x55 /* 'U' */ :
273 case 0x56 /* 'V' */ :
274 case 0x57 /* 'W' */ :
275 case 0x58 /* 'X' */ :
276 case 0x59 /* 'Y' */ :
277 case 0x5a /* 'Z' */ :
282 case 0x61 /* 'a' */ :
283 case 0x62 /* 'b' */ :
284 case 0x63 /* 'c' */ :
285 case 0x64 /* 'd' */ :
286 case 0x65 /* 'e' */ :
287 case 0x66 /* 'f' */ :
288 case 0x67 /* 'g' */ :
289 case 0x68 /* 'h' */ :
290 case 0x69 /* 'i' */ :
291 case 0x6a /* 'j' */ :
292 case 0x6b /* 'k' */ :
293 case 0x6c /* 'l' */ :
294 case 0x6d /* 'm' */ :
295 case 0x6e /* 'n' */ :
296 case 0x6f /* 'o' */ :
297 case 0x70 /* 'p' */ :
298 case 0x71 /* 'q' */ :
299 case 0x72 /* 'r' */ :
300 case 0x73 /* 's' */ :
301 case 0x74 /* 't' */ :
302 case 0x75 /* 'u' */ :
303 case 0x76 /* 'v' */ :
304 case 0x77 /* 'w' */ :
305 case 0x78 /* 'x' */ :
306 case 0x79 /* 'y' */ :
307 case 0x7a /* 'z' */ :
314 throw antlr::NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
321 case 0x41 /* 'A' */ :
322 case 0x42 /* 'B' */ :
323 case 0x43 /* 'C' */ :
324 case 0x44 /* 'D' */ :
325 case 0x45 /* 'E' */ :
326 case 0x46 /* 'F' */ :
327 case 0x47 /* 'G' */ :
328 case 0x48 /* 'H' */ :
329 case 0x49 /* 'I' */ :
330 case 0x4a /* 'J' */ :
331 case 0x4b /* 'K' */ :
332 case 0x4c /* 'L' */ :
333 case 0x4d /* 'M' */ :
334 case 0x4e /* 'N' */ :
335 case 0x4f /* 'O' */ :
336 case 0x50 /* 'P' */ :
337 case 0x51 /* 'Q' */ :
338 case 0x52 /* 'R' */ :
339 case 0x53 /* 'S' */ :
340 case 0x54 /* 'T' */ :
341 case 0x55 /* 'U' */ :
342 case 0x56 /* 'V' */ :
343 case 0x57 /* 'W' */ :
344 case 0x58 /* 'X' */ :
345 case 0x59 /* 'Y' */ :
346 case 0x5a /* 'Z' */ :
351 case 0x61 /* 'a' */ :
352 case 0x62 /* 'b' */ :
353 case 0x63 /* 'c' */ :
354 case 0x64 /* 'd' */ :
355 case 0x65 /* 'e' */ :
356 case 0x66 /* 'f' */ :
357 case 0x67 /* 'g' */ :
358 case 0x68 /* 'h' */ :
359 case 0x69 /* 'i' */ :
360 case 0x6a /* 'j' */ :
361 case 0x6b /* 'k' */ :
362 case 0x6c /* 'l' */ :
363 case 0x6d /* 'm' */ :
364 case 0x6e /* 'n' */ :
365 case 0x6f /* 'o' */ :
366 case 0x70 /* 'p' */ :
367 case 0x71 /* 'q' */ :
368 case 0x72 /* 'r' */ :
369 case 0x73 /* 's' */ :
370 case 0x74 /* 't' */ :
371 case 0x75 /* 'u' */ :
372 case 0x76 /* 'v' */ :
373 case 0x77 /* 'w' */ :
374 case 0x78 /* 'x' */ :
375 case 0x79 /* 'y' */ :
376 case 0x7a /* 'z' */ :
381 case 0x30 /* '0' */ :
382 case 0x31 /* '1' */ :
383 case 0x32 /* '2' */ :
384 case 0x33 /* '3' */ :
385 case 0x34 /* '4' */ :
386 case 0x35 /* '5' */ :
387 case 0x36 /* '6' */ :
388 case 0x37 /* '7' */ :
389 case 0x38 /* '8' */ :
390 case 0x39 /* '9' */ :
403 _ttype
= testLiteralsTable(text
.substr(_begin
, text
.length()-_begin
),_ttype
);
404 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
405 _token
= makeToken(_ttype
);
406 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
408 _returnToken
= _token
;
412 void RequirementLexer::mDOTKEY(bool _createToken
) {
413 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
415 std::string::size_type _saveIndex
;
420 if ((LA(1) == 0x2e /* '.' */ )) {
424 case 0x41 /* 'A' */ :
425 case 0x42 /* 'B' */ :
426 case 0x43 /* 'C' */ :
427 case 0x44 /* 'D' */ :
428 case 0x45 /* 'E' */ :
429 case 0x46 /* 'F' */ :
430 case 0x47 /* 'G' */ :
431 case 0x48 /* 'H' */ :
432 case 0x49 /* 'I' */ :
433 case 0x4a /* 'J' */ :
434 case 0x4b /* 'K' */ :
435 case 0x4c /* 'L' */ :
436 case 0x4d /* 'M' */ :
437 case 0x4e /* 'N' */ :
438 case 0x4f /* 'O' */ :
439 case 0x50 /* 'P' */ :
440 case 0x51 /* 'Q' */ :
441 case 0x52 /* 'R' */ :
442 case 0x53 /* 'S' */ :
443 case 0x54 /* 'T' */ :
444 case 0x55 /* 'U' */ :
445 case 0x56 /* 'V' */ :
446 case 0x57 /* 'W' */ :
447 case 0x58 /* 'X' */ :
448 case 0x59 /* 'Y' */ :
449 case 0x5a /* 'Z' */ :
450 case 0x61 /* 'a' */ :
451 case 0x62 /* 'b' */ :
452 case 0x63 /* 'c' */ :
453 case 0x64 /* 'd' */ :
454 case 0x65 /* 'e' */ :
455 case 0x66 /* 'f' */ :
456 case 0x67 /* 'g' */ :
457 case 0x68 /* 'h' */ :
458 case 0x69 /* 'i' */ :
459 case 0x6a /* 'j' */ :
460 case 0x6b /* 'k' */ :
461 case 0x6c /* 'l' */ :
462 case 0x6d /* 'm' */ :
463 case 0x6e /* 'n' */ :
464 case 0x6f /* 'o' */ :
465 case 0x70 /* 'p' */ :
466 case 0x71 /* 'q' */ :
467 case 0x72 /* 'r' */ :
468 case 0x73 /* 's' */ :
469 case 0x74 /* 't' */ :
470 case 0x75 /* 'u' */ :
471 case 0x76 /* 'v' */ :
472 case 0x77 /* 'w' */ :
473 case 0x78 /* 'x' */ :
474 case 0x79 /* 'y' */ :
475 case 0x7a /* 'z' */ :
480 case 0x30 /* '0' */ :
481 case 0x31 /* '1' */ :
482 case 0x32 /* '2' */ :
483 case 0x33 /* '3' */ :
484 case 0x34 /* '4' */ :
485 case 0x35 /* '5' */ :
486 case 0x36 /* '6' */ :
487 case 0x37 /* '7' */ :
488 case 0x38 /* '8' */ :
489 case 0x39 /* '9' */ :
496 throw antlr::NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
508 _ttype
= testLiteralsTable(_ttype
);
509 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
510 _token
= makeToken(_ttype
);
511 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
513 _returnToken
= _token
;
517 void RequirementLexer::mINTEGER(bool _createToken
) {
518 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
520 std::string::size_type _saveIndex
;
525 if (((LA(1) >= 0x30 /* '0' */ && LA(1) <= 0x39 /* '9' */ ))) {
529 if ( _cnt69
>=1 ) { goto _loop69
; } else {throw antlr::NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
536 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
537 _token
= makeToken(_ttype
);
538 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
540 _returnToken
= _token
;
544 void RequirementLexer::mPATHNAME(bool _createToken
) {
545 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
547 std::string::size_type _saveIndex
;
554 if ((LA(1) == 0x2f /* '/' */ )) {
559 if ( _cnt54
>=1 ) { goto _loop54
; } else {throw antlr::NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
566 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
567 _token
= makeToken(_ttype
);
568 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
570 _returnToken
= _token
;
574 void RequirementLexer::mHASHCONSTANT(bool _createToken
) {
575 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
576 _ttype
= HASHCONSTANT
;
577 std::string::size_type _saveIndex
;
579 _saveIndex
= text
.length();
580 match('H' /* charlit */ );
581 text
.erase(_saveIndex
);
582 _saveIndex
= text
.length();
583 match('\"' /* charlit */ );
584 text
.erase(_saveIndex
);
588 if ((_tokenSet_1
.member(LA(1)))) {
592 if ( _cnt57
>=1 ) { goto _loop57
; } else {throw antlr::NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
599 _saveIndex
= text
.length();
600 match('\"' /* charlit */ );
601 text
.erase(_saveIndex
);
602 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
603 _token
= makeToken(_ttype
);
604 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
606 _returnToken
= _token
;
610 void RequirementLexer::mHEX(bool _createToken
) {
611 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
613 std::string::size_type _saveIndex
;
616 case 0x30 /* '0' */ :
617 case 0x31 /* '1' */ :
618 case 0x32 /* '2' */ :
619 case 0x33 /* '3' */ :
620 case 0x34 /* '4' */ :
621 case 0x35 /* '5' */ :
622 case 0x36 /* '6' */ :
623 case 0x37 /* '7' */ :
624 case 0x38 /* '8' */ :
625 case 0x39 /* '9' */ :
630 case 0x61 /* 'a' */ :
631 case 0x62 /* 'b' */ :
632 case 0x63 /* 'c' */ :
633 case 0x64 /* 'd' */ :
634 case 0x65 /* 'e' */ :
635 case 0x66 /* 'f' */ :
640 case 0x41 /* 'A' */ :
641 case 0x42 /* 'B' */ :
642 case 0x43 /* 'C' */ :
643 case 0x44 /* 'D' */ :
644 case 0x45 /* 'E' */ :
645 case 0x46 /* 'F' */ :
652 throw antlr::NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
655 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
656 _token
= makeToken(_ttype
);
657 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
659 _returnToken
= _token
;
663 void RequirementLexer::mHEXCONSTANT(bool _createToken
) {
664 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
665 _ttype
= HEXCONSTANT
;
666 std::string::size_type _saveIndex
;
668 _saveIndex
= text
.length();
669 match('0' /* charlit */ );
670 text
.erase(_saveIndex
);
671 _saveIndex
= text
.length();
672 match('x' /* charlit */ );
673 text
.erase(_saveIndex
);
677 if ((_tokenSet_1
.member(LA(1)))) {
681 if ( _cnt60
>=1 ) { goto _loop60
; } else {throw antlr::NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
688 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
689 _token
= makeToken(_ttype
);
690 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
692 _returnToken
= _token
;
696 void RequirementLexer::mSTRING(bool _createToken
) {
697 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
699 std::string::size_type _saveIndex
;
701 _saveIndex
= text
.length();
702 match('\"' /* charlit */ );
703 text
.erase(_saveIndex
);
706 if ((LA(1) == 0x5c /* '\\' */ )) {
708 _saveIndex
= text
.length();
709 match('\\' /* charlit */ );
710 text
.erase(_saveIndex
);
711 match('\"' /* charlit */ );
714 else if ((_tokenSet_2
.member(LA(1)))) {
728 _saveIndex
= text
.length();
729 match('\"' /* charlit */ );
730 text
.erase(_saveIndex
);
731 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
732 _token
= makeToken(_ttype
);
733 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
735 _returnToken
= _token
;
739 void RequirementLexer::mARROW(bool _createToken
) {
740 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
742 std::string::size_type _saveIndex
;
745 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
746 _token
= makeToken(_ttype
);
747 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
749 _returnToken
= _token
;
753 void RequirementLexer::mSEMI(bool _createToken
) {
754 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
756 std::string::size_type _saveIndex
;
758 match(';' /* charlit */ );
759 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
760 _token
= makeToken(_ttype
);
761 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
763 _returnToken
= _token
;
767 void RequirementLexer::mLPAREN(bool _createToken
) {
768 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
770 std::string::size_type _saveIndex
;
772 match('(' /* charlit */ );
773 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
774 _token
= makeToken(_ttype
);
775 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
777 _returnToken
= _token
;
781 void RequirementLexer::mRPAREN(bool _createToken
) {
782 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
784 std::string::size_type _saveIndex
;
786 match(')' /* charlit */ );
787 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
788 _token
= makeToken(_ttype
);
789 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
791 _returnToken
= _token
;
795 void RequirementLexer::mLBRACK(bool _createToken
) {
796 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
798 std::string::size_type _saveIndex
;
800 match('[' /* charlit */ );
801 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
802 _token
= makeToken(_ttype
);
803 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
805 _returnToken
= _token
;
809 void RequirementLexer::mRBRACK(bool _createToken
) {
810 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
812 std::string::size_type _saveIndex
;
814 match(']' /* charlit */ );
815 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
816 _token
= makeToken(_ttype
);
817 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
819 _returnToken
= _token
;
823 void RequirementLexer::mLESS(bool _createToken
) {
824 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
826 std::string::size_type _saveIndex
;
828 match('<' /* charlit */ );
829 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
830 _token
= makeToken(_ttype
);
831 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
833 _returnToken
= _token
;
837 void RequirementLexer::mGT(bool _createToken
) {
838 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
840 std::string::size_type _saveIndex
;
842 match('>' /* charlit */ );
843 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
844 _token
= makeToken(_ttype
);
845 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
847 _returnToken
= _token
;
851 void RequirementLexer::mLE(bool _createToken
) {
852 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
854 std::string::size_type _saveIndex
;
857 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
858 _token
= makeToken(_ttype
);
859 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
861 _returnToken
= _token
;
865 void RequirementLexer::mGE(bool _createToken
) {
866 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
868 std::string::size_type _saveIndex
;
871 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
872 _token
= makeToken(_ttype
);
873 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
875 _returnToken
= _token
;
879 void RequirementLexer::mCOMMA(bool _createToken
) {
880 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
882 std::string::size_type _saveIndex
;
884 match(',' /* charlit */ );
885 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
886 _token
= makeToken(_ttype
);
887 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
889 _returnToken
= _token
;
893 void RequirementLexer::mEQL(bool _createToken
) {
894 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
896 std::string::size_type _saveIndex
;
898 match('=' /* charlit */ );
899 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
900 _token
= makeToken(_ttype
);
901 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
903 _returnToken
= _token
;
907 void RequirementLexer::mEQQL(bool _createToken
) {
908 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
910 std::string::size_type _saveIndex
;
913 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
914 _token
= makeToken(_ttype
);
915 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
917 _returnToken
= _token
;
921 void RequirementLexer::mSUBS(bool _createToken
) {
922 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
924 std::string::size_type _saveIndex
;
926 match('~' /* charlit */ );
927 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
928 _token
= makeToken(_ttype
);
929 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
931 _returnToken
= _token
;
935 void RequirementLexer::mNEG(bool _createToken
) {
936 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
938 std::string::size_type _saveIndex
;
940 match('-' /* charlit */ );
941 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
942 _token
= makeToken(_ttype
);
943 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
945 _returnToken
= _token
;
949 void RequirementLexer::mNOT(bool _createToken
) {
950 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
952 std::string::size_type _saveIndex
;
954 match('!' /* charlit */ );
955 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
956 _token
= makeToken(_ttype
);
957 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
959 _returnToken
= _token
;
963 void RequirementLexer::mSTAR(bool _createToken
) {
964 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
966 std::string::size_type _saveIndex
;
968 match('*' /* charlit */ );
969 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
970 _token
= makeToken(_ttype
);
971 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
973 _returnToken
= _token
;
977 void RequirementLexer::mWS(bool _createToken
) {
978 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
980 std::string::size_type _saveIndex
;
986 case 0x20 /* ' ' */ :
988 match(' ' /* charlit */ );
991 case 0xa /* '\n' */ :
993 match('\n' /* charlit */ );
997 case 0x9 /* '\t' */ :
999 match('\t' /* charlit */ );
1004 if ( _cnt90
>=1 ) { goto _loop90
; } else {throw antlr::NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
1011 _ttype
= antlr::Token::SKIP
;
1012 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
1013 _token
= makeToken(_ttype
);
1014 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
1016 _returnToken
= _token
;
1020 void RequirementLexer::mSHELLCOMMENT(bool _createToken
) {
1021 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
1022 _ttype
= SHELLCOMMENT
;
1023 std::string::size_type _saveIndex
;
1025 match('#' /* charlit */ );
1028 if ((_tokenSet_3
.member(LA(1)))) {
1029 matchNot('\n' /* charlit */ );
1038 _ttype
= antlr::Token::SKIP
;
1039 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
1040 _token
= makeToken(_ttype
);
1041 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
1043 _returnToken
= _token
;
1047 void RequirementLexer::mC_COMMENT(bool _createToken
) {
1048 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
1050 std::string::size_type _saveIndex
;
1055 if ((LA(1) == 0x2a /* '*' */ ) && (_tokenSet_4
.member(LA(2)))) {
1057 match('*' /* charlit */ );
1059 matchNot('/' /* charlit */ );
1063 else if ((_tokenSet_5
.member(LA(1)))) {
1065 matchNot('*' /* charlit */ );
1076 _ttype
= antlr::Token::SKIP
;
1077 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
1078 _token
= makeToken(_ttype
);
1079 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
1081 _returnToken
= _token
;
1085 void RequirementLexer::mCPP_COMMENT(bool _createToken
) {
1086 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
1087 _ttype
= CPP_COMMENT
;
1088 std::string::size_type _saveIndex
;
1093 if ((_tokenSet_3
.member(LA(1)))) {
1094 matchNot('\n' /* charlit */ );
1103 _ttype
= antlr::Token::SKIP
;
1104 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
1105 _token
= makeToken(_ttype
);
1106 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
1108 _returnToken
= _token
;
1113 const unsigned long RequirementLexer::_tokenSet_0_data_
[] = { 0UL, 0UL, 134217726UL, 134217726UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
1114 const antlr::BitSet
RequirementLexer::_tokenSet_0(_tokenSet_0_data_
,10);
1115 const unsigned long RequirementLexer::_tokenSet_1_data_
[] = { 0UL, 67043328UL, 126UL, 126UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
1116 // 0 1 2 3 4 5 6 7 8 9
1117 const antlr::BitSet
RequirementLexer::_tokenSet_1(_tokenSet_1_data_
,10);
1118 const unsigned long RequirementLexer::_tokenSet_2_data_
[] = { 4294967295UL, 4294967291UL, 4026531839UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967292UL, 2097151UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
1119 // 0x0 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xa 0xb 0xc 0xd 0xe 0xf 0x10
1120 // 0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e
1121 // 0x1f ! # $ % & \' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 :
1122 const antlr::BitSet
RequirementLexer::_tokenSet_2(_tokenSet_2_data_
,16);
1123 const unsigned long RequirementLexer::_tokenSet_3_data_
[] = { 4294966271UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967292UL, 2097151UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
1124 // 0x0 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xb 0xc 0xd 0xe 0xf 0x10 0x11
1125 // 0x12 0x13 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f
1126 // ! \" # $ % & \' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 :
1127 const antlr::BitSet
RequirementLexer::_tokenSet_3(_tokenSet_3_data_
,16);
1128 const unsigned long RequirementLexer::_tokenSet_4_data_
[] = { 4294967295UL, 4294934527UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967292UL, 2097151UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
1129 // 0x0 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xa 0xb 0xc 0xd 0xe 0xf 0x10
1130 // 0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e
1131 // 0x1f ! \" # $ % & \' ( ) * + , - . 0 1 2 3 4 5 6 7 8 9 :
1132 const antlr::BitSet
RequirementLexer::_tokenSet_4(_tokenSet_4_data_
,16);
1133 const unsigned long RequirementLexer::_tokenSet_5_data_
[] = { 4294967295UL, 4294966271UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967292UL, 2097151UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
1134 // 0x0 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xa 0xb 0xc 0xd 0xe 0xf 0x10
1135 // 0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e
1136 // 0x1f ! \" # $ % & \' ( ) + , - . / 0 1 2 3 4 5 6 7 8 9 :
1137 const antlr::BitSet
RequirementLexer::_tokenSet_5(_tokenSet_5_data_
,16);