]> git.saurik.com Git - cycript.git/blame - Driver.cpp
Improve accuracy of JNI local references tracking.
[cycript.git] / Driver.cpp
CommitLineData
7341eedb
JF
1/* Cycript - The Truly Universal Scripting Language
2 * Copyright (C) 2009-2016 Jay Freeman (saurik)
b12a9965
JF
3*/
4
f95d2598 5/* GNU Affero General Public License, Version 3 {{{ */
b12a9965 6/*
f95d2598
JF
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU Affero General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
b12a9965 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
f95d2598
JF
15 * GNU Affero General Public License for more details.
16
17 * You should have received a copy of the GNU Affero General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
b12a9965
JF
19**/
20/* }}} */
21
b12a9965 22#include "Driver.hpp"
20052ff7 23#include "Syntax.hpp"
8a392978
JF
24
25bool CYParser(CYPool &pool, bool debug);
b12a9965 26
c3d9dbc7 27CYDriver::CYDriver(CYPool &pool, std::streambuf &data, const std::string &filename) :
2c1d569a 28 pool_(pool),
675ff733 29 newline_(false),
a5662a53 30 last_(false),
b12a9965 31 data_(data),
d9c91152 32 debug_(0),
b12a9965 33 strict_(false),
b900e1a4 34 highlight_(false),
b12a9965 35 filename_(filename),
a7d8b413 36 script_(NULL),
b12a9965
JF
37 auto_(false),
38 context_(NULL),
39 mode_(AutoNone)
40{
b12a9965 41 in_.push(false);
9d2b125d 42 return_.push(false);
c5b15840 43 super_.push(false);
b900e1a4 44 template_.push(false);
9d2b125d
JF
45 yield_.push(false);
46
b12a9965
JF
47 ScannerInit();
48}
49
50CYDriver::~CYDriver() {
51 ScannerDestroy();
52}
53
2c1d569a
JF
54void CYDriver::Replace(CYOptions &options) {
55 CYLocal<CYPool> local(&pool_);
d9c91152 56 CYContext context(options);
a7d8b413 57 script_->Replace(context);
d9c91152 58}