PEBL 2.2
Psychology Experiment Building Language - Cross-platform psychological experiment development system
VCGMaker.cpp File Reference
#include "../base/PNode.h"
#include "../base/grammar.tab.hpp"
#include "../base/VCG.h"
#include "../base/Evaluator.h"
#include "../devices/PEventLoop.h"
#include <iostream>

Go to the source code of this file.

Functions

PNodeparse (const char *filename)
 
int PEBLInterpret (int argc, char **argv)
 
int main (int argc, char **argv)
 

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 95 of file VCGMaker.cpp.

96{
97 return PEBLInterpret(argc, argv);
98}
int PEBLInterpret(int argc, char **argv)
Definition VCGMaker.cpp:50

References PEBLInterpret().

◆ parse()

PNode * parse ( const char *  filename)

◆ PEBLInterpret()

int PEBLInterpret ( int  argc,
char **  argv 
)

Definition at line 50 of file VCGMaker.cpp.

51{
52
53 PNode * tmp = NULL;
54
55 //Process the first command-line argument.
56 cerr << "Processing PEBL Source File: " << argv[1] << endl;
57 PNode * head = parse(argv[1]);
58
59 //If there are any more arguments, process them by accomodating them
60 //inside a function list.
61 for(int i = 2; i<argc; i++)
62 {
63 cerr << "Processing PEBL Source File: " << argv[i] << endl;
64
65 //Make a new node.
66 tmp = parse(argv[i]);
67
68 //Now, make a new node that contains head and tmp.
69 head = new OpNode(PEBL_FUNCTIONS, head, tmp, "Unknown file",0);
70 }
71
72
73 //Now, head should point to the top of the tree containing all of the source.
74 if(head)
75 {
76 cerr << "---------Encoding VCG GRAPH---------" << endl;
77 VCG myVCG;
78 myVCG.MakeGraph(head);
79
80 cerr << "---------Printing VCG GRAPH---------" << endl;
81 myVCG.PrintGraph();
82
83 cerr << "---------FINISHED VCG GRAPH---------" << endl;
84
85 return 0;
86 }
87
88 cerr << "Error: parsed node was empty" << endl;
89 return 1;
90}
#define NULL
Definition BinReloc.cpp:317
PNode * head
Definition PEBL.cpp:220
PNode * parse()
Definition PNode.h:45
Definition VCG.h:44
void PrintGraph()
Definition VCG.cpp:71
void MakeGraph(const PNode *node)
Definition VCG.cpp:65

References head, VCG::MakeGraph(), NULL, parse(), and VCG::PrintGraph().

Referenced by main().