- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathZError.cpp
More file actions
Latest commit
42 lines (38 loc) · 1.58 KB
/
Copy pathZError.cpp
File metadata and controls
42 lines (38 loc) · 1.58 KB
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
#include"stdafx.h"
#include"ZError.h"
#include"ZInterp.h"
#definePARSER ZInterp::cxtr->pTreeParser
#defineRECOGNIZERPARSER->rec
#defineINPUTPARSER->ctnstream
#defineISTREAMINPUT->tnstream->istream
#defineMATCHT(t, fs) RECOGNIZER->match(RECOGNIZER, t, fs)
#defineMATCHANYT() RECOGNIZER->matchAny(RECOGNIZER)
#defineCONSUME() ISTREAM->consume(ISTREAM)
#defineLA(n) ISTREAM->_LA(ISTREAM, n)
#defineLT(n) INPUT->tnstream->_LT(INPUT->tnstream, n)
#defineSEEK(n) ISTREAM->seek(ISTREAM, n)
int ZError::Lnum()
{
while(true)
{
pANTLR3_BASE_TREE x = (pANTLR3_BASE_TREE)(ZInterp::cxtr->pTreeParser->rec->getCurrentInputSymbol(ZInterp::cxtr->pTreeParser->rec, ZInterp::cxtr->pTreeParser->ctnstream->tnstream->istream));
if((x->getType(x)!=ANTLR3_TOKEN_UP) && (x->getType(x)!=ANTLR3_TOKEN_DOWN))
{
return x->getToken(x)->user1;
}
MATCHANYT();
}
}
intZError::Cnum()
{
while(true)
{
pANTLR3_BASE_TREE x = (pANTLR3_BASE_TREE)(ZInterp::cxtr->pTreeParser->rec->getCurrentInputSymbol(ZInterp::cxtr->pTreeParser->rec, ZInterp::cxtr->pTreeParser->ctnstream->tnstream->istream));
if((x->getType(x)!=ANTLR3_TOKEN_UP) && (x->getType(x)!=ANTLR3_TOKEN_DOWN))
// if(x->getToken(x)->charPosition>0)
return x->getToken(x)->user2;
MATCHANYT();
}
pANTLR3_BASE_TREE x = (pANTLR3_BASE_TREE)(ZInterp::cxtr->pTreeParser->rec->getCurrentInputSymbol(ZInterp::cxtr->pTreeParser->rec, ZInterp::cxtr->pTreeParser->ctnstream->tnstream->istream));
return x->getToken(x)->line;
}