-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcobmain.h
executable file
·153 lines (136 loc) · 4.21 KB
/
cobmain.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
/*
* File: cobmain.h
* Created Date: Sunday August 31st 2014
* Author: Deepak Purandare
* -----
* Last Modified: Sunday August 31st 2014 8:37:47 pm
* Modified By: Deepak Purandare - <deepak_purandare@hotmail.com>
* -----
* Copyright (c) 2019 Purndare Consulting
* This software is made available under GNU General Public License Version 3
* Visit http://www.gnu.org/licenses/gpl-3.0.html for terms of usage.
*/
#ifndef COB7_H
#define COB7_H
#ifdef __cplusplus
extern "C"
{
#endif
extern char **fileList;
extern unsigned currentFile;
extern unsigned nFiles;
extern FILE *yyin;
extern char *currentFileName;
/* command line arguments */
extern int file_format;
extern int dump_flag;
extern int analyze_only;
extern int generate_only;
extern int analyze_generate;
extern int stopFound;
/* from the lexer */
extern char *currentline;
typedef enum
{
FREE = 0,
FIXED = 1
} format;
// parser related items
#define DBG_TOK 2
#define DBG_PARSER 2
#define DBG_TRACE 2
#define DBG_ERROR 3
#define DEBUG 3
#define debug_print(...) \
do \
{ \
if (DEBUG) \
fprintf(stdout, __VA_ARGS__); \
} while (0)
#define dbg_print(x, ...) \
do \
{ \
if (x >= DEBUG) \
fprintf(stdout, __VA_ARGS__); \
} while (0)
#define COB_MINI_BUFF 256
#define COB_SMALL_BUFF 1024
#define COB_NORMAL_BUFF 2048
#define COB_MEDIUM_BUFF 8192
#define APP_VERSION 1
#define APP_BUILD 17
#define APP_VERSION_BUILD ((APP_VERSION) \
: (APP_BUILD))
int myinput(char *buff, int max_size);
static size_t plexsize;
static char *plexbuff = NULL;
static int read_literal_str(int quote);
void disp_help();
#ifdef __cplusplus
}
#endif
#endif /* COB7_H */
/*
COBOL Project/Program structure (nodes with cardinality) (not complete)
Project -1
ProjectInfo -1
Name -1
FilesType: fixed/free -1
DateTimeOfAnalysis -1
Files 1
FileInfo +
Name -1
ProjectFileDetails -1
ProjectItem +
Type -1 --Program or Function
FileName -1
PrgramName -1
IdentificationDivision -? --for function division the IdentificationDivision is not present
programName -1
common_initial -?
author -?
installation -?
dateWritten -?
datecompiled -?
securityOptions -?
remarks -?
EnvironmentDivision -? --there could be programs without Env Div
ConfigurationSection -?
SourceComp -?
ObjectComp -?
SpecialName -?
InputOutputSection -?
FileControl -?
FileControlItem +
Optional
Assignment
Reserve
Organization
Padding
Delimiter
AccessMode
LockMode
CodeSet
CollartingSequence
RecordKey
AlternateKey
FileStatus
IOControl
--Not now
DataDivision -?
FileSection -?
WorkingStorageSection -?
LinkageSection -?
CommunicationSection -?
ScreenSection -?
ReportSection -?
LocalStorageSection -?
ProdedureDivision -1
ProcDivPreamble
UsingClause -?
ChainingClause -?
ReturningClause -?
Declaratives -?
ProcDivItem
Type : Section, Paragraph, Sentence or top level items (CobProcDivItem)
*/