Home | History | Annotate | Download | only in preprocessor

Lines Matching refs:yylvalpp

56 static int CPPif(yystypepp * yylvalpp);
151 static int CPPdefine(yystypepp * yylvalpp)
159 token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
164 name = yylvalpp->sc_ident;
165 token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
166 if (token == '(' && !yylvalpp->sc_int) {
170 token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
177 args[argc++] = yylvalpp->sc_ident;
178 token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
187 token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
198 RecordToken(mac.body, token, yylvalpp);
199 token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
214 old_token = ReadToken(symb->details.mac.body, yylvalpp);
215 old_lval = yylvalpp->sc_int;
216 token = ReadToken(mac.body, yylvalpp);
217 if (token != old_token || yylvalpp->sc_int != old_lval) {
239 static int CPPundef(yystypepp * yylvalpp)
241 int token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
249 symb = LookUpSymbol(macros, yylvalpp->sc_ident);
253 token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
266 static int CPPelse(int matchelse, yystypepp * yylvalpp)
269 int token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
274 token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
280 token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
283 if ((token = cpp->currentInput->scan(cpp->currentInput, yylvalpp)) != CPP_IDENTIFIER)
285 atom = yylvalpp->sc_ident;
302 token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
306 token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
322 return CPPif(yylvalpp);
396 static int eval(int token, int prec, int *res, int *err, yystypepp * yylvalpp)
401 if (yylvalpp->sc_ident == definedAtom) {
403 token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
406 token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
410 *res = (s = LookUpSymbol(macros, yylvalpp->sc_ident))
412 token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
416 token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
418 } else if (MacroExpand(yylvalpp->sc_ident, yylvalpp)) {
419 token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
420 return eval(token, prec, res, err, yylvalpp);
425 *res = yylvalpp->sc_int;
426 token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
428 token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
429 token = eval(token, MIN_PREC, res, err, yylvalpp);
433 token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
441 token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
442 token = eval(token, UNARY, res, err, yylvalpp);
457 yylvalpp);
458 token = eval(token, binop[i].prec, res, err, yylvalpp);
469 static int CPPif(yystypepp * yylvalpp) {
470 int token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
480 token = eval(token, MIN_PREC, &res, &err, yylvalpp);
484 token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
492 token = CPPelse(1, yylvalpp);
498 static int CPPifdef(int defined, yystypepp * yylvalpp)
500 int token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
501 int name = yylvalpp->sc_ident;
512 token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
516 token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
524 token = CPPelse(1, yylvalpp);
529 static int CPPline(yystypepp * yylvalpp)
531 int token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
539 yylvalpp->sc_int=atoi(yylvalpp->symbol_name);
540 SetLineNumber(yylvalpp->sc_int);
541 token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
544 yylvalpp->sc_int=atoi(yylvalpp->symbol_name);
545 SetStringNumber(yylvalpp->sc_int);
546 token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
563 static int CPPerror(yystypepp * yylvalpp) {
565 int token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
573 StoreStr(yylvalpp->symbol_name);
575 StoreStr(GetStringOfAtom(atable,yylvalpp->sc_ident));
579 token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
591 static int CPPpragma(yystypepp * yylvalpp)
600 int token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
618 SrcStr = GetAtomString(atable, yylvalpp->sc_ident);
623 SrcStr = yylvalpp->symbol_name;
628 SrcStr = yylvalpp->symbol_name;
642 token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
645 cpp->currentInput->ungetch(cpp->currentInput, token, yylvalpp);
647 token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
660 static int CPPversion(yystypepp * yylvalpp)
663 int token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
677 yylvalpp->sc_int=atoi(yylvalpp->symbol_name);
678 //SetVersionNumber(yylvalpp->sc_int);
680 if (yylvalpp->sc_int != ESSL_VERSION_NUMBER)
683 token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
694 static int CPPextension(yystypepp * yylvalpp)
697 int token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
710 strncpy(extensionName, GetAtomString(atable, yylvalpp->sc_ident), MAX_SYMBOL_NAME_LEN);
713 token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
719 token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
725 updateExtensionBehavior(extensionName, GetAtomString(atable, yylvalpp->sc_ident));
727 token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
737 int readCPPline(yystypepp * yylvalpp)
739 int token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
744 if (yylvalpp->sc_ident == defineAtom) {
745 token = CPPdefine(yylvalpp);
746 } else if (yylvalpp->sc_ident == elseAtom) {
752 token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
756 token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
763 token = CPPelse(0, yylvalpp);
770 } else if (yylvalpp->sc_ident == elifAtom) {
776 token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
778 token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
785 token = CPPelse(0, yylvalpp);
786 } else if (yylvalpp->sc_ident == endifAtom) {
794 } else if (yylvalpp->sc_ident == ifAtom) {
795 token = CPPif(yylvalpp);
796 } else if (yylvalpp->sc_ident == ifdefAtom) {
797 token = CPPifdef(1, yylvalpp);
798 } else if (yylvalpp->sc_ident == ifndefAtom) {
799 token = CPPifdef(0, yylvalpp);
800 } else if (yylvalpp->sc_ident == lineAtom) {
801 token = CPPline(yylvalpp);
802 } else if (yylvalpp->sc_ident == pragmaAtom) {
803 token = CPPpragma(yylvalpp);
804 } else if (yylvalpp->sc_ident == undefAtom) {
805 token = CPPundef(yylvalpp);
806 } else if (yylvalpp->sc_ident == errorAtom) {
807 token = CPPerror(yylvalpp);
808 } else if (yylvalpp->sc_ident == versionAtom) {
809 token = CPPversion(yylvalpp);
811 } else if (yylvalpp->sc_ident == extensionAtom) {
812 token = CPPextension(yylvalpp);
815 StoreStr(GetStringOfAtom(atable,yylvalpp->sc_ident));
822 token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
850 static int eof_scan(InputSrc *in, yystypepp * yylvalpp) { return -1; }
851 static void noop(InputSrc *in, int ch, yystypepp * yylvalpp) { }
871 static TokenStream *PrescanMacroArg(TokenStream *a, yystypepp * yylvalpp) {
876 token = ReadToken(a, yylvalpp);
877 if (token == CPP_IDENTIFIER && LookUpSymbol(macros, yylvalpp->sc_ident))
884 while ((token = cpp->currentInput->scan(cpp->currentInput, yylvalpp)) > 0) {
885 if (token == CPP_IDENTIFIER && MacroExpand(yylvalpp->sc_ident, yylvalpp))
887 RecordToken(n, token, yylvalpp);
903 static int macro_scan(MacroInputSrc *in, yystypepp * yylvalpp) {
905 int token = ReadToken(in->mac->body, yylvalpp);
908 if (in->mac->args[i] == yylvalpp->sc_ident) break;
910 ReadFromTokenStream(in->args[i], yylvalpp->sc_ident, 0);
911 return cpp->currentInput->scan(cpp->currentInput, yylvalpp);
923 return cpp->currentInput->scan(cpp->currentInput, yylvalpp);
932 int MacroExpand(int atom, yystypepp * yylvalpp)
939 yylvalpp->sc_int = GetLineNumber();
940 sprintf(yylvalpp->symbol_name,"%d",yylvalpp->sc_int);
941 UngetToken(CPP_INTCONSTANT, yylvalpp);
945 yylvalpp->sc_int = GetStringNumber();
946 sprintf(yylvalpp->symbol_name,"%d",yylvalpp->sc_int);
947 UngetToken(CPP_INTCONSTANT, yylvalpp);
951 strcpy(yylvalpp->symbol_name,ESSL_VERSION_STRING);
952 yylvalpp->sc_int = atoi(yylvalpp->symbol_name);
953 UngetToken(CPP_INTCONSTANT, yylvalpp);
965 token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
967 UngetToken(token, yylvalpp);
968 yylvalpp->sc_ident = atom;
978 token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
991 RecordToken(in->args[i], token, yylvalpp);
1013 token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
1032 in->args[i] = PrescanMacroArg(in->args[i], yylvalpp);