Skip to content

Latest commit

 

History

History
60 lines (53 loc) · 1.56 KB

PostParser.cpp

File metadata and controls

60 lines (53 loc) · 1.56 KB
 
Dec 17, 1999
Dec 17, 1999
1
2
3
4
5
/* PostParser.cpp - Implementation of the PostParser class
*
* Copyright (c) 1999 Ryan C. Gordon and Gregory S. Read.
*/
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include "PostParser.h"
#include <stdio.h>
#include <string.h>
// Constructor
PostParser::PostParser()
{
}
// Destructor
PostParser::~PostParser()
{
}
Dec 17, 1999
Dec 17, 1999
20
21
22
23
24
25
26
27
28
29
void PostParser::ReportError(ParserException *pException)
/* Description
* Called by parser grammar to report any exceptions that are raised
* as a result of parsing.
* Parameters
* pException - Pointer to a ParserException object
* Returns
* none
*/
{
Dec 26, 1999
Dec 26, 1999
30
31
// We'll just report it generically for now.
printf("<<<%s>>>", pException->toString().data());
Dec 17, 1999
Dec 17, 1999
32
33
}
34
void PostParser::VarDecl(BasicScope Scope, RefToken VarName, RefToken DataType,
Dec 17, 1999
Dec 17, 1999
35
36
37
38
39
40
41
42
43
44
45
46
Boolean WithEvents, Boolean AsNew)
/* Description
* Declares a variable
* Parameters
* Scope - Context scope of the variable
* VarName - Pointer to a token that represents the variable name.
* DataType - Pointer to a token that represents the data type.
* WithEvents - TRUE if variables was declared using "WithEvents"
* AsNew - TRUE if variable was also instantiated.
* Returns
* none
*/
Dec 17, 1999
Dec 17, 1999
48
49
50
51
52
char strDataType[64];
if(DataType == NULL)
strcpy(strDataType, "Variant");
else
strcpy(strDataType, DataType->getText().data());
Dec 17, 1999
Dec 17, 1999
54
55
56
57
58
59
printf("Declared %s as type %s\n", VarName->getText().data(), strDataType);
if(WithEvents)
printf("Declared WithEvents\n");
if(AsNew)
printf("Object created\n");