GNU PROLOG with UTF8 support
ma_parser.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------*
2  * GNU Prolog *
3  * *
4  * Part : mini-assembler to assembler translator *
5  * File : ma_parser.h *
6  * Descr.: parser - header file *
7  * Author: Daniel Diaz *
8  * *
9  * Copyright (C) 1999-2015 Daniel Diaz *
10  * *
11  * This file is part of GNU Prolog *
12  * *
13  * GNU Prolog is free software: you can redistribute it and/or *
14  * modify it under the terms of either: *
15  * *
16  * - the GNU Lesser General Public License as published by the Free *
17  * Software Foundation; either version 3 of the License, or (at your *
18  * option) any later version. *
19  * *
20  * or *
21  * *
22  * - the GNU General Public License as published by the Free *
23  * Software Foundation; either version 2 of the License, or (at your *
24  * option) any later version. *
25  * *
26  * or both in parallel, as here. *
27  * *
28  * GNU Prolog is distributed in the hope that it will be useful, *
29  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
30  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
31  * General Public License for more details. *
32  * *
33  * You should have received copies of the GNU General Public License and *
34  * the GNU Lesser General Public License along with this program. If *
35  * not, see http://www.gnu.org/licenses/. *
36  *-------------------------------------------------------------------------*/
37 
38 
39 #include "../EnginePl/pl_long.h"
40 
41 
42 /*---------------------------------*
43  * Constants *
44  *---------------------------------*/
45 
46 /*---------------------------------*
47  * Type Definitions *
48  *---------------------------------*/
49 
50 typedef enum
51 {
52  IDENTIFIER = 256, /* not a type but a token */
55  MEM, /* not a token but a type */
61 }
62 ArgTyp;
63 
64 
65 
66 
67 typedef struct
68 {
69  char *name;
70  int index;
71 }
72 Mem;
73 
74 
75 
76 
77 typedef struct
78 {
80  int adr_of;
81  union
82  {
83  char *str_val; /* for string */
84  PlLong int_val; /* for integer */
85  double dbl_val; /* for double */
86  Mem mem; /* for mem */
87  int index; /* for X() Y() FL() FD() */
88  }
89  t;
90 }
91 ArgInf;
92 
93 
94 
95 
96 typedef struct
97 {
99  char *label;
100 }
101 SwtInf;
102 
103 
104 
105 
106 typedef enum
107 {
111 }
112 VType;
113 
114 
115 
116 /*---------------------------------*
117  * Global Variables *
118  *---------------------------------*/
119 
120 /*---------------------------------*
121  * Function Prototypes *
122  *---------------------------------*/
123 
124 int Parse_Ma_File(char *file_name_in, int comment);
125 
126 void Syntax_Error(char *s);
Definition: ma_parser.h:60
Definition: ma_parser.h:108
int adr_of
Definition: ma_parser.h:80
char * label
Definition: ma_parser.h:99
char * name
Definition: ma_parser.h:69
ArgTyp
Definition: ma_parser.h:50
VType
Definition: ma_parser.h:106
Definition: ma_parser.h:54
int Parse_Ma_File(char *file_name_in, int comment)
Definition: ma_parser.c:172
intptr_t PlLong
Definition: gprolog.h:88
int comment
Definition: ma2asm.c:100
Definition: ma_parser.h:109
double dbl_val
Definition: ma_parser.h:85
Definition: ma_parser.h:56
Definition: ma_parser.h:59
Definition: wam_inst.h:249
Definition: ma_parser.h:67
Definition: ma_parser.h:77
char * file_name_in
Definition: ma2asm.c:95
Definition: ma_parser.h:110
Mem mem
Definition: ma_parser.h:86
Definition: ma_parser.h:53
int t[10]
Definition: asm.c:28
Definition: ma_parser.h:55
Definition: ma_parser.h:58
PlLong int_val
Definition: ma_parser.h:98
PlLong int_val
Definition: ma_parser.h:84
void Syntax_Error(char *s)
Definition: ma_parser.c:826
ArgTyp type
Definition: ma_parser.h:79
Definition: ma_parser.h:57
Definition: ma_parser.h:52
int index
Definition: ma_parser.h:70
char * str_val
Definition: ma_parser.h:83
int index
Definition: ma_parser.h:87