⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 code.g

📁 有用
💻 G
字号:
-- ACCENT -- -- A Compiler Compiler for the Entire Class of Context-Free Languages-- -- Copyright (C) 1999  Friedrich Wilhelm Schroeer-- -- This program is free software; you can redistribute it and/or modify-- it under the terms of the GNU General Public License as published by-- the Free Software Foundation; either version 2 of the License, or-- (at your option) any later version.-- -- This program is distributed in the hope that it will be useful,-- but WITHOUT ANY WARRANTY; without even the implied warranty of-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the-- GNU General Public License for more details.-- -- You should have received a copy of the GNU General Public License-- along with this program; if not, write to the Free Software-- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.'module' code'export' fix_code'action' Put(STRING)'action' Nl'action' fix_code      'rule' fix_code      Nl      Put("extern YYSTYPE yylval;") Nl      Put("YYSTYPE yylval;") Nl      Put("extern long yypos;") Nl      Put("") Nl      Put("typedef struct LEXELEMSTRUCT {") Nl      Put("   YYSTYPE val;") Nl      Put("   long pos;") Nl      Put("   struct LEXELEMSTRUCT *next;") Nl      Put("} LEXELEM;") Nl      Put("   ") Nl      Put("LEXELEM *first_lexelem, *cur_lexelem;") Nl      Put("") Nl      Put("init_lexelem()") Nl      Put("{") Nl      Put("   cur_lexelem = first_lexelem;") Nl      Put("}") Nl      Put("") Nl      Put("first_lexval () {") Nl      Put("   LEXELEM *p;") Nl      Put("   p = (LEXELEM *)malloc(sizeof(LEXELEM));") Nl      Put("   if (! p) yymallocerror();") Nl      Put("   p->val = yylval;") Nl      Put("   p->pos = yypos;") Nl      Put("   p->next = 0;") Nl      Put("   cur_lexelem = p;") Nl      Put("   first_lexelem = p;") Nl      Put("}") Nl      Put("") Nl      Put("next_lexval() {") Nl      Put("   LEXELEM *p;") Nl      Put("   p = (LEXELEM *)malloc(sizeof(LEXELEM));") Nl      Put("   if (! p) yymallocerror();") Nl      Put("   cur_lexelem-> next = p;") Nl      Put("   p->val = yylval;") Nl      Put("   p->pos = yypos;") Nl      Put("   p->next = 0;") Nl      Put("   cur_lexelem = p;") Nl      Put("}") Nl      Put("") Nl      Put("get_lexval() {") Nl      Put("   yylval = cur_lexelem->val;") Nl      Put("   yypos = cur_lexelem->pos;") Nl      Put("   cur_lexelem = cur_lexelem->next;") Nl      Put("}") Nl      Nl

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -