jplus-0.4.7
jplus.h
Go to the documentation of this file.
1/* -*- mode: c++; indent-tabs-mode:nil -*- */
2#ifndef JPLUS_H
3#define JPLUS_H
4
5#include <istream>
6#include <vector>
7#include <set>
8#include "jengine.h"
9
10class BasicBlock;
11
15class jplus: public jengine {
16private:
17 BasicBlock* program;
18
19public:
22
26 bool init(std::istream &script);
27
30
36 bool set(std::string name, jarray data);
37
42 jarray get(std::string name);
43
49 std::vector<std::string> getProgram(std::set<std::string> vars);
50
54 std::vector<std::string> getProgram();
55
56protected:
61 virtual void libInit();
62
63private:
64 // copy disabled
65 jplus(const jplus &);
66 const jplus& operator=(const jplus&);
67};
68
69#endif
C++ representation of J array.
Definition jarray.h:25
Interface to dynamically loaded J engine.
Definition jengine.h:13
A J+ script.
Definition jplus.h:15
bool set(std::string name, jarray data)
Set value of the specified variable inside J+ environment, mark all dependent variables "dirty".
jarray get(std::string name)
Perform all the necessary calculations to computate the specified variable, return its value in an ar...
bool init(std::istream &script)
Load and pre-parse J+ script.
jplus()
initialize J+ engine with no script
std::vector< std::string > getProgram(std::set< std::string > vars)
Pull minimal set of J sentences for computing a given set of variables, assuming everything is "dirty...
virtual void libInit()
Called by the constructor before parsing the J+ script.
~jplus()
Free allocated memory.
std::vector< std::string > getProgram()
Pull all the sentences in J+ script.