?? parser.h
字號:
// Parser.h: interface for the CParser class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_PARSER_H__EAEE30FB_2CDD_477C_835B_585836403C22__INCLUDED_)
#define AFX_PARSER_H__EAEE30FB_2CDD_477C_835B_585836403C22__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "Lex.h"
#include <stdio.h>
#include <stdarg.h>
#include <windows.h>
#include <wingdi.h>
typedef double(*FuncPtr)(double);
struct ExprNode
{
enum Token_Type OpCode;
union UnionContent
{
struct Operator {ExprNode *Left,*Right;} CaseOperator;
struct Func {ExprNode *Child;FuncPtr MathFuncPtr;} CaseFunc;
double CaseConst;
double *CaseParmPtr;
} Content;
};
class CParser
{
public:
CParser();
virtual ~CParser();
void Parser(char *FileName,HDC hDC);
void SyntaxError(int caseof);
void FetchToken();
void ErrMsg(int LineNo,char *descrip,char *str);
void Program();
void Statement();
void MatchToken(enum Token_Type tokentype);
void OrignStatement();
struct ExprNode *Expression();
struct ExprNode *Term();
struct ExprNode*Factor();
struct ExprNode*Comp();
struct ExprNode*AtomComp();
struct ExprNode*MakeExprNode(enum Token_Type opcode,...);
void PrintSyntaxTree(ExprNode *root,int indent);
void DelExprTree(ExprNode*root);
double GetExprValue(ExprNode *root);
void ScaleStatement(void);
void RotStatement(void);
void ForStatement(void);
void DrawLoop(double Start,double End,double Step,
ExprNode *HorPtr,ExprNode*VerPtr);
void CalcCoord(ExprNode*Hor_Exp,ExprNode*Ver_Exp);
void DrawPixel();
CLex mylex;
Token m_token;
double Parameter,
Origin_x,Origin_y,
x,y,
Scale_x,Scale_y,
Rot_angle;
HDC hdc;
};
#endif // !defined(AFX_PARSER_H__EAEE30FB_2CDD_477C_835B_585836403C22__INCLUDED_)
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -