da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin/***********************************************************************
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* This software is part of the ast package *
34f9b3eef6fdadbda0a846aa4d68691ac40eace5Roland Mainz* Copyright (c) 1986-2009 AT&T Intellectual Property *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* and is licensed under the *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* Common Public License, Version 1.0 *
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin* by AT&T Intellectual Property *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* A copy of the License is available at *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* Information and Software Systems Research *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* AT&T Research *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* Florham Park NJ *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* Glenn Fowler <gsf@research.att.com> *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin***********************************************************************/
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * Glenn Fowler
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * AT&T Research
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * preprocessor lexical analyzer definitions
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#define CODE(tok,act) ((((tok)-N_PP)<<(BITTERM+1))|(act))
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#define NEXT(st) (((st)>>(BITTERM+1))&((1<<BITNONTERM)-1))
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * FSM states
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * NOTE: preserve the ranges
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * proto non-terminal states
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * quick non-terminal states
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * tokenize non-terminal states
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * quick terminal states grouped together
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * and the remaining terminal states
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * the last terminal state (for tracing)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * pseudo terminal states
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * common lex macros
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * NOTE: common local variable names assumed
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin } while (0)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if (!INCOMMENT(rp) && !(pp.state & (NOTEXT|SKIPCONTROL))) \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if ((pp.in->flags & IN_flush) && pp.level == 1 && !INMACRO(rp) && (!pp.comment || !INCOMMENT(rp)) && (c = op - pp.outbuf) > 0 && *(op - 1) == '\n') \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin } while (0)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin debug((-7, "POP in=%s next=%s state=%s", ppinstr(cur), pptokchr(*prv->nextchr), pplexstr(INDEX(rp)))); \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin } while (0)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * fsm implementaion globals
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * first index is state, second is char, value is next state
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * except for fsm[TERMINAL] where second is state+1 for EOF transition
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * the index is char, value is trigraph value for <?><?><char>, 0 if invalid
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern void refill(int);