?? action.h
字號:
//Action.h
#pragma once
#include "Grammar.h"
#include "SymbTable.h"
using namespace std;
//該_Action類定義了動作符號對應的動作.
class _Action
{
public:
_Action(Grammar *grammar):g(grammar)
{
_intc.size = 1;
_intc.kind = intTy;
_charc.size = 1;
_charc.kind = charTy;
}
~_Action() {};
//輸入當前TOKEN和動作符號,調用相應動作.
void call_action(const symbol &act_sym, list<TOKEN>::iterator token_pos);
SymbTable symbtable; //符號表
protected:
stack<semantic_record> sem_stack; //語義棧
Grammar *g; //文法類提供動作文法.
//以下為各種語義
void _ProgHead();
void _Id(list<TOKEN>::iterator token_pos);
void _BaseType(list<TOKEN>::iterator token_pos);
void _Intc(list<TOKEN>::iterator token_pos);
void _ArrayType();
void _RecordType();
void _TypeDec();
void _FieldDec();
void _Param();
void _VarDec();
void _ParamVar();
void _AddLevel();
void _SubLevel();
TypeIR _intc;
TypeIR _charc;
};
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -