-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCNSFileToAST.h
More file actions
33 lines (30 loc) · 929 Bytes
/
Copy pathCNSFileToAST.h
File metadata and controls
33 lines (30 loc) · 929 Bytes
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
// CNSFileToAST.h — Pipeline stage that reads a CNS source file and produces an AST.
//
// Part of Sourcy — CNS -> Lua compiler for MUGEN-style characters.
// Licensed under the MIT License. See LICENSE in the project root.
//
// Author: Miguel Angel Exposito Sanchez (radexx), 2012.
#pragma once
#include "PipelineStage.h"
#include "CNSParserStuff.h"
#include <string>
class CNSFileToAST :
public PipelineStage,
public InputFilePipelineStage,
public OutputASTPipelineStage
{
public:
CNSFileToAST(Pipeline * p);
~CNSFileToAST();
void reset() override;
void run() override;
void setInputFilePath(std::string &fname) override { m_filename = fname; }
pANTLR3_BASE_TREE getOutputAST() override { return m_cnsAST.tree; }
private:
std::string m_filename;
pANTLR3_INPUT_STREAM m_input;
pcnsLexer m_lxr;
pANTLR3_CUSTOM_TOKEN_STREAM m_tstream;
pcnsParser m_psr;
cnsParser_cns_return m_cnsAST;
};