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

📄 syn_sem.h

📁 这是一个完整的词法分析器
💻 H
字号:


// Nom Du Fichier		: syn_sem.h
// Fonction				: Programmation entete de analyseur syntaxique et sementique
// Cadre				: TP Compilation
// Auteurs				: Wei zhouyue
// Date					: 15/03/2005


#include <iostream>
#include <fstream>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
       
#define  BMaxlen  10000     
#define  Maxlen  50     
#define  Motcle_No  20       
#define  Signsymbole_No  13     
#define  Limitsymbole_No  9      
#define  ERROR  -1   
    
using namespace std;

/******************************************************************************************************************************************/
char Str[BMaxlen];      
char FichierNom[100];      
int  pStr=-1;            
char *MOTCLE[Motcle_No]={"Debut","Fin","Si","Alors","Sinon","Finsi","Repeter","Tantque","Faire","Fintantque","Pour","JUSQUA","De","A","Finpour","Lire","Ecrire","Non","Et","Ou"};	
char *SIGNSYMBOLE[Signsymbole_No]={"=","+","-","*","/",">","<",">=","<=","==","!=","++","--"};
char *LIMITSYMBOLE[Limitsymbole_No]={"(",")","[","]","{","}",",",":",";"};
char ch;                
int  Fbuffer;         
char Stoker[Maxlen];      
int Type_no; 
bool Erreur;
int no_ligne=1;
int Prevtype;
bool negatif;
FILE *fp,*fp1;                 
            
int Debut_chercher();        
void Ensource();          
int LireUs();
void nb_ligne();
void programme();  
void liste_instructions();
void suite_instructions();
void instruction();
void affectation();
void conditionnelle();
void suite_conditionnelle();
void iteration();
void ea();
void suite_ea();
void ea1();
void suite_ea1();
void ea2();
void operande();
void signe(bool negatif);
void condition();
void suite_condition();
void condition1();
void suite_condition1();
void condition2();
void condition3();
void relation();
void suite_relation();


void operateur_comparaison();
void operateur_logique(); 
void expression_booleenne();
void suite_condition();
    

⌨️ 快捷键说明

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