-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathcomm.h
91 lines (85 loc) · 1.23 KB
/
comm.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#pragma once
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <iostream>
#include <fstream>
#include <sstream>
#include <map>
#include <set>
#include <vector>
#include <string>
#include <stack>
using namespace std;
const int _out=1;
enum asm_format_t{format_bin=0,format_elf32,format_win32};
const char format_name_table[][100]={"bin","elf32","win32"};
typedef char* cptr;
struct token_t //struct of token
{
string s;
int n;
int p;
int line;
};
struct grammar_t;
typedef grammar_t* gptr;
struct grammar_t //struct of grammar tree
{
string n;
int v;
int p;//格式,横排 竖排
//quater *qp;
vector <gptr> l;
void c()
{
n="";
v=0;
p=0;
l.clear();
}
grammar_t()
{
n="";
v=0;
p=0;
l.clear();
}
int prt(int level=0)
{
int i,j;
for(j=0;j<level;j++) printf(" ");
printf("%s\n",n.c_str());
/*if(g->n=="quat")
{
g->qp->prt(n+1);
}
else*/
for(i=0;i<l.size();i++)
{
l[i]->prt(level+1);
}
return 0;
}
};
struct quat_t //quaternion
{
string s1,s2,s3,s4;
};
struct var_type_t //type for variable table
{
string s;
int addr;
string func;
vector <string> para;
int n;
void clear()
{
n=0;
s="";
addr=-1;
func="";
para.clear();
}
};