• Home
  • Raw
  • Download

Lines Matching refs:rec

60 static void					displayRecognitionError	    (pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 * tokenName…
61 static void reportError (pANTLR3_BASE_RECOGNIZER rec);
66 static void reset (pANTLR3_BASE_RECOGNIZER rec);
88 lexer->rec = antlr3BaseRecognizerNew(ANTLR3_TYPE_LEXER, sizeHint, state); in antlr3LexerNew()
90 if (lexer->rec == NULL) in antlr3LexerNew()
95 lexer->rec->super = lexer; in antlr3LexerNew()
97 lexer->rec->displayRecognitionError = displayRecognitionError; in antlr3LexerNew()
98 lexer->rec->reportError = reportError; in antlr3LexerNew()
99 lexer->rec->reset = reset; in antlr3LexerNew()
100 lexer->rec->getCurrentInputSymbol = getCurrentInputSymbol; in antlr3LexerNew()
101 lexer->rec->getMissingSymbol = getMissingSymbol; in antlr3LexerNew()
105 if (lexer->rec->state->tokSource == NULL) in antlr3LexerNew()
107 …lexer->rec->state->tokSource = (pANTLR3_TOKEN_SOURCE)ANTLR3_CALLOC(1, sizeof(ANTLR3_TOKEN_SOURCE)); in antlr3LexerNew()
109 if (lexer->rec->state->tokSource == NULL) in antlr3LexerNew()
111 lexer->rec->free(lexer->rec); in antlr3LexerNew()
116 lexer->rec->state->tokSource->super = lexer; in antlr3LexerNew()
121 lexer->rec->state->tokSource->nextToken = nextToken; in antlr3LexerNew()
122 lexer->rec->state->tokSource->strFactory = NULL; in antlr3LexerNew()
124 lexer->rec->state->tokFactory = NULL; in antlr3LexerNew()
149 specialT = &(lexer->rec->state->tokSource->eofToken); in antlr3LexerNew()
162 specialT = &(lexer->rec->state->tokSource->skipToken); in antlr3LexerNew()
175 reset (pANTLR3_BASE_RECOGNIZER rec) in reset() argument
179 lexer = (pANTLR3_LEXER)rec->super; in reset()
181 lexer->rec->state->token = NULL; in reset()
182 lexer->rec->state->type = ANTLR3_TOKEN_INVALID; in reset()
183 lexer->rec->state->channel = ANTLR3_TOKEN_DEFAULT_CHANNEL; in reset()
184 lexer->rec->state->tokenStartCharIndex = -1; in reset()
185 lexer->rec->state->tokenStartCharPositionInLine = -1; in reset()
186 lexer->rec->state->tokenStartLine = -1; in reset()
188 lexer->rec->state->text = NULL; in reset()
193 if (lexer->rec->state->tokFactory != NULL) in reset()
195 lexer->rec->state->tokFactory->reset(lexer->rec->state->tokFactory); in reset()
225 state = lexer->rec->state; in nextTokenStr()
283 lexer->rec->reportError(lexer->rec); in nextTokenStr()
357 …if (lexer->rec->state->streams != NULL && lexer->rec->state->streams->size(lexer->rec->state->str… in nextToken()
411 reportError (pANTLR3_BASE_RECOGNIZER rec) in reportError() argument
415 rec->state->errorCount++; in reportError()
417 rec->displayRecognitionError(rec, rec->state->tokenNames); in reportError()
434 ex = lexer->rec->state->exception; in displayRecognitionError()
475 (ANTLR3_UINT32)(lexer->rec->state->tokenStartLine), in displayRecognitionError()
476 (ANTLR3_UINT32)(lexer->rec->state->tokenStartCharPositionInLine) in displayRecognitionError()
478 …>input->data)+(lexer->input->size(lexer->input))) - (pANTLR3_UINT8)(lexer->rec->state->tokenStartC… in displayRecognitionError()
482 …s like this:\n\t\t%.*s\n", width > 20 ? 20 : width ,(pANTLR3_UINT8)(lexer->rec->state->tokenStartC… in displayRecognitionError()
503 if (lexer->rec->state->tokFactory == NULL) in setCharStream()
505 lexer->rec->state->tokFactory = antlr3TokenFactoryNew(input); in setCharStream()
515 lexer->rec->state->tokFactory->setInputStream(lexer->rec->state->tokFactory, input); in setCharStream()
521 if (lexer->rec->state->tokSource->strFactory == NULL) in setCharStream()
523 lexer->rec->state->tokSource->strFactory = input->strFactory; in setCharStream()
528 if (lexer->rec->state->tokSource->eofToken.strFactory == NULL) in setCharStream()
530 lexer->rec->state->tokSource->eofToken.strFactory = input->strFactory; in setCharStream()
536 lexer->rec->exConstruct = antlr3RecognitionExceptionNew; in setCharStream()
540 lexer->rec->state->token = NULL; in setCharStream()
541 lexer->rec->state->text = NULL; in setCharStream()
542 lexer->rec->state->tokenStartCharIndex = -1; in setCharStream()
546 lexer->rec->state->tokSource->fileName = input->fileName; in setCharStream()
568 if (lexer->rec->state->streams == NULL) in pushCharStream()
573 lexer->rec->state->streams = antlr3StackNew(0); in pushCharStream()
575 if (lexer->rec->state->streams == NULL) in pushCharStream()
588 lexer->rec->state->streams->push(lexer->rec->state->streams, lexer->input, NULL); in pushCharStream()
617 …if (lexer->rec->state->streams != NULL && lexer->rec->state->streams->size(lexer->rec->state->stre… in popCharStream()
625 input = (pANTLR3_INPUT_STREAM)(lexer->rec->state->streams->top); in popCharStream()
626 lexer->rec->state->streams->pop(lexer->rec->state->streams); in popCharStream()
638 lexer->rec->state->token = token; /* Voila! */ in emitNew()
651 token = lexer->rec->state->tokFactory->newToken(lexer->rec->state->tokFactory); in emit()
658 token->type = lexer->rec->state->type; in emit()
659 token->channel = lexer->rec->state->channel; in emit()
660 token->start = lexer->rec->state->tokenStartCharIndex; in emit()
662 token->line = lexer->rec->state->tokenStartLine; in emit()
663 token->charPosition = lexer->rec->state->tokenStartCharPositionInLine; in emit()
665 if (lexer->rec->state->text != NULL) in emit()
668 token->tokText.text = lexer->rec->state->text; in emit()
675 token->user1 = lexer->rec->state->user1; in emit()
676 token->user2 = lexer->rec->state->user2; in emit()
677 token->user3 = lexer->rec->state->user3; in emit()
678 token->custom = lexer->rec->state->custom; in emit()
680 lexer->rec->state->token = token; in emit()
695 if (lexer->rec->state != NULL) in freeLexer()
697 if (lexer->rec->state->streams != NULL) in freeLexer()
699 lexer->rec->state->streams->free(lexer->rec->state->streams); in freeLexer()
701 if (lexer->rec->state->tokFactory != NULL) in freeLexer()
703 lexer->rec->state->tokFactory->close(lexer->rec->state->tokFactory); in freeLexer()
704 lexer->rec->state->tokFactory = NULL; in freeLexer()
706 if (lexer->rec->state->tokSource != NULL) in freeLexer()
708 ANTLR3_FREE(lexer->rec->state->tokSource); in freeLexer()
709 lexer->rec->state->tokSource = NULL; in freeLexer()
712 if (lexer->rec != NULL) in freeLexer()
714 lexer->rec->free(lexer->rec); in freeLexer()
715 lexer->rec = NULL; in freeLexer()
734 if (lexer->rec->state->backtracking > 0) in matchs()
736 lexer->rec->state->failed = ANTLR3_TRUE; in matchs()
740 lexer->rec->exConstruct(lexer->rec); in matchs()
741 lexer->rec->state->failed = ANTLR3_TRUE; in matchs()
756 lexer->rec->state->failed = ANTLR3_FALSE; in matchs()
781 lexer->rec->state->failed = ANTLR3_FALSE; in matchc()
788 if (lexer->rec->state->backtracking > 0) in matchc()
790 lexer->rec->state->failed = ANTLR3_TRUE; in matchc()
794 lexer->rec->exConstruct(lexer->rec); in matchc()
826 lexer->rec->state->failed = ANTLR3_FALSE; in matchRange()
834 if (lexer->rec->state->backtracking > 0) in matchRange()
836 lexer->rec->state->failed = ANTLR3_TRUE; in matchRange()
840 lexer->rec->exConstruct(lexer->rec); in matchRange()
881 if (lexer->rec->state->text) in getText()
883 return lexer->rec->state->text; in getText()
888 lexer->rec->state->tokenStartCharIndex, in getText()