?? careme.txt
字號(hào):
==============================================================================================
《一》 本類C語(yǔ)言語(yǔ)法規(guī)則以及語(yǔ)義翻譯文法規(guī)則
===============================================================================================
<1> < program>::=main(){ <declaration_list><statement_list> }
<2> <declaration_list>::= { <declaration_stat> }
<3> <dclaration_stat>::=INT|CHAR ID;
<dclaration_stat>::= @ vartable,datep->int |char ID@ name_def;
<4><statement_list>::={ <statement> }
<5><statement>::=<assign_expr>|<if_stat>|<while_stat>|<for_stat>|<compound_stat>
<6> <assign_expr>:: ID=<addictive>;
<7><if_stat>::=if<bool_expr><statement>[else <statement>]
<8><while_stat>::=while(<bool_expr>)<statement>
<while_stat>::=while @SETlabel1 (<bool_expr>)
@BRFlabel2 <statement> @BRlabel1@SETlabel2
<9><for_stat>::=(<assign_expr>;<bool_expr>;<assign_expr>)<statement>
<for_stat>::=(<assign_expr>;
@SETlabel1<bool_expr>; 設(shè)置標(biāo)號(hào)1
@BRF label2@BR label3 輸出標(biāo)號(hào)2和3
@SETlabel4<assign_expr>)@BR label1 設(shè)置標(biāo)號(hào)4并輸出標(biāo)號(hào)1
@SETlabel3<statement>@BR label4 設(shè)置標(biāo)號(hào)3并輸出標(biāo)號(hào)4
@SETlabel2 設(shè)置標(biāo)號(hào)2
<10><compound_stat>::={ <declaration_list><statement_list> }
<11><bool_addictive>::=<addictive>(>|<|>=|<=|==|!=)<addictive>
<bool_addictive>::=<addictive> > <addictive> @GT
<bool_addictive>::=<addictive> < <addictive> @LT
<bool_addictive>::=<addictive> >= <addictive> @GE
<bool_addictive>::=<addictive> <= <addictive> @LE
<bool_addictive>::=<addictive> ==<addictive> @EQ
<bool_addictive>::=<addictive> !=<addictive> @NEQ
<12><addictive>::=<term>{ (+|-) <term> }
<addictive>::=<term>{ + <term> @ADD|- <tern> @SUB }
<13><term>::=<factor>{ (*|/)<factor> }
<term>::=<factor>{ *<factor> @MUL| /< factor > @DIV }
<14><factor>::=(<addictive>)|ID|NUM
<factor>::=(<addictive>)|ID @lookup|NUM@loadi
<15><read_stat>::=read ID;
<read>::=read ID lookup @IN @STI;
<16><write_stat>::=write<addictive_expr>;
<write_stat>::=write<addictive_expr>@OUT;
===============================================================================================
《二》 基于棧式抽象機(jī)的匯編指令代碼一覽表
================================================================================================
LOAD D 將 D 中的內(nèi)容壓入操作數(shù)棧
LOADI N 將常量壓入操作數(shù)棧
STO D 將操作數(shù)棧頂單元內(nèi)容存入D且棧頂內(nèi)容不變
STI D 操作數(shù)棧頂單元內(nèi)容存入D且操作數(shù)棧頂單元內(nèi)容出棧
ADD 次棧單元內(nèi)容與操作數(shù)棧頂單元內(nèi)容出棧相加,和保存在操作數(shù)棧頂單元內(nèi)容
SUB 次棧單元內(nèi)容與操作數(shù)棧頂單元內(nèi)容出棧相減,差保存在操作數(shù)棧頂單元內(nèi)容
MUL 次棧單元內(nèi)容與操作數(shù)棧頂單元內(nèi)容出棧相乘,積保存在操作數(shù)棧頂單元內(nèi)容
DIV 次棧單元內(nèi)容與操作數(shù)棧頂單元內(nèi)容出棧相除,商保存在操作數(shù)棧頂單元內(nèi)容
BR LAB 無(wú)條件轉(zhuǎn)移到LAB
BRF LAB 檢查操作數(shù)棧頂單元邏輯值,為假則轉(zhuǎn)移到LAB
EQ 次棧單元內(nèi)容與操作數(shù)棧頂單元內(nèi)容相比較,將結(jié)果(0§1)置于棧頂
NEQ 次棧單元內(nèi)容與操作數(shù)棧頂單元內(nèi)容相比較,將結(jié)果(0§1)置于棧頂
GT 次棧單元內(nèi)容與操作數(shù)棧頂單元內(nèi)容相減,若大于0,將結(jié)果1 置于棧頂
LT 次棧單元內(nèi)容與操作數(shù)棧頂單元內(nèi)容相減,若小于0,將結(jié)果1 置于棧頂
GE 次棧單元內(nèi)容與操作數(shù)棧頂單元內(nèi)容相減,若大于等于0,將結(jié)果1 置于棧頂
LE 次棧單元內(nèi)容與操作數(shù)棧頂單元內(nèi)容相減,若小于等于0,將結(jié)果1 置于棧頂
IN 標(biāo)準(zhǔn)輸入整型數(shù)或字符型,并置于棧頂
OUT 操作數(shù)棧頂單元內(nèi)容出棧,并送入標(biāo)準(zhǔn)輸出
STOP 停止執(zhí)行
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -