5 * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
6 * Set (PCCTS) -- PCCTS is in the public domain. An individual or
7 * company may do whatever they wish with source code distributed with
8 * PCCTS or the code generated by PCCTS, including the incorporation of
9 * PCCTS, or its output, into commerical software.
11 * We encourage users to develop software with PCCTS. However, we do ask
12 * that credit is given to us for developing PCCTS. By "credit",
13 * we mean that if you incorporate our source code into one of your
14 * programs (commercial product, research project, or otherwise) that you
15 * acknowledge this fact somewhere in the documentation, research report,
16 * etc... If you like PCCTS and have developed a nice tool with the
17 * output, please mention that you developed it using PCCTS. In
18 * addition, we ask that this header remain intact in our source code.
19 * As long as these guidelines are kept, we expect to continue enhancing
20 * this system and expect to make other tools available as they are
25 * Parr Research Corporation
26 * with Purdue University and AHPCRC, University of Minnesota
29 #define ZZINC {if ( track_columns ) (++_endcol);}
31 #define ZZGETC {ch = input->nextChar(); cl = ZZSHIFT(ch);}
33 #define ZZNEWSTATE (newstate = dfa[state][cl])
37 /* Truncate matching buffer to size (not an error) */ \
38 if (nextpos < lastpos){ \
48 /* points to base of dfa table */
51 /* have to redo class since using different compression */
54 sprintf((char *)ebuf,"Invalid automaton mode = %d ",m);
59 ANTLRTokenType DLGLexer::
62 register int state, newstate;
63 /* last space reserved for the null char */
64 register DLGChar *lastpos;
69 lastpos = &_lextext[_bufsize-1];
75 /* interactive version of automaton */
76 /* if there is something in ch, process it */
77 state = newstate = dfa_base[automaton];
83 while (alternatives[newstate]){
90 /* figure out if last character really part of token */
91 if ((state != dfa_base[automaton]) && (newstate == DfaStates)){
99 /* Able to transition out of start state to some non err state?*/
100 if ( state == dfa_base[automaton] ){
101 /* make sure doesn't get stuck */
105 else { /* non-interactive version of automaton */
110 state = dfa_base[automaton];
111 while (ZZNEWSTATE != DfaStates) {
118 if ( state == dfa_base[automaton] ){
119 if (nextpos < lastpos){
125 /* make sure doesn't get stuck */
131 if ( track_columns ) _endcol -= charfull;
132 _endexpr = nextpos -1;
135 tk = (ANTLRTokenType)
136 (*actions[accepts[state]])(this); // must pass this manually
137 // actions is not a [] of pointers
138 // to member functions.
140 tk = (this->*actions[accepts[state]])();
151 if ( input==NULL ) err_in();
152 ZZGETC; charfull = 1; ZZINC;