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

📄 visual_yacc

📁 編譯器的虛擬yacc工具
💻
字号:
#!/bin/csh -f# What This Is:	 Script which takes a lex and yacc specification pair#		    and builds a visual parser.# Author:	 Elizabeth White and Laura Deddens# Email:	 white@cs.gmu.edu # Last Modified: 5 September 1998   set VY		=	/cs-faculty/white/Vyacc_dist   set INSTALL_BIN	=	${VY}/bin   set INSTALL_LIB	=	${VY}/lib   set MOTIF_LIB	=	(-L/usr/openwin/lib -L/usr/dt/lib)# You should not change anything below this point    set CC		=	gcc   set VYACC		=	${INSTALL_BIN}/vyacc   set TRANSFORM	=	${INSTALL_BIN}/pre_vyacc   set LEXFIX		=	${INSTALL_BIN}/fix_lex   set YACCFIX		=	${INSTALL_BIN}/yaccfix   set INCLUDE_DIR	=	${VY}/Include   set STEPPAR		=	${INCLUDE_DIR}/stepPar   set ECHOCMD		=	echo   set FNAME		=	$1#pretest the yaccablity, lexablity, and compilablity of .y and .l before traslation   $ECHOCMD ""   $ECHOCMD "Pretest ..."   $ECHOCMD "   If no errors generated by this phase, your input is legal"   $YACCFIX $FNAME.y   yacc -d $FNAME.y.vy   lex $FNAME.l   $CC -o pretest.out y.tab.c lex.yy.c -ly -ll -lm#run the parser through the tool   $ECHOCMD "   Cleaning up pretest ..."   rm pretest.out $FNAME.y.vy   $ECHOCMD ""   $ECHOCMD "Building ..."   $ECHOCMD "   Preprocessing $FNAME.y ..."   $TRANSFORM < $FNAME.y > ${FNAME}_pre.y   $ECHOCMD "   Preprocessing $FNAME.l ..."   $LEXFIX < $FNAME.l > ${FNAME}_pre.l   $ECHOCMD "   Translating $FNAME.y ..."   $VYACC < ${FNAME}_pre.y > ${FNAME}_vyacc.y   $ECHOCMD "   Lexing ..."   lex ${FNAME}_pre.l   $ECHOCMD "   Yaccing translation ..."   yacc -P $STEPPAR -d ${FNAME}_vyacc.y#compile the result being sure to link with the vyacc libraries   $ECHOCMD "   Compiling translation and lex.yy.c..."   $CC -o $FNAME.out y.tab.c lex.yy.c -ly -ll -lm $MOTIF_LIB \        -lXm -lXt  -lX11 -I$INCLUDE_DIR 	\        -L$INSTALL_LIB -lvyacc# clean up    $ECHOCMD "Cleaning up ..."    rm ${FNAME}_vyacc.y ${FNAME}_pre.y ${FNAME}_pre.l    rm y.tab.* lex.yy.c#tell how to use the result   echo ""   echo "To do a visualization type:"   echo "    $FNAME.out < <input_string>"

⌨️ 快捷键说明

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