Commit 2c3f1ba7 authored by Sarah Spall's avatar Sarah Spall Committed by Vikram Narayanan

moved main and changed its name to main

parent 99c7740b
lcd_compiler: lcd_ast.o lcd_compiler.o lcd_idl.o scope.o compiler: lcd_ast.o main.o lcd_idl.o scope.o
g++ lcd_idl.o lcd_ast.o scope.o lcd_compiler.o -o compiler g++ lcd_idl.o lcd_ast.o scope.o main.o -o compiler
lcd_compiler.o: lcd_compiler.cpp include/lcd_ast.h lcd_idl.h main.o: main/main.cpp include/lcd_ast.h lcd_idl.h
g++ -c -g lcd_compiler.cpp g++ -c -g main/main.cpp
lcd_idl.o: lcd_idl.h include/lcd_ast.h lcd_idl.cpp lcd_idl.o: lcd_idl.h include/lcd_ast.h lcd_idl.cpp
g++ -c parser/lcd_idl.cpp g++ -c parser/lcd_idl.cpp
...@@ -23,5 +23,5 @@ lcd_idl.cpp: ...@@ -23,5 +23,5 @@ lcd_idl.cpp:
clean: clean:
rm parser/lcd_idl.cpp parser/lcd_idl.h lcd_ast.h.gch compiler *.o rm parser/lcd_idl.cpp parser/lcd_idl.h lcd_ast.h.gch compiler *.o
test: lcd_compiler test: compiler
./test/test.py ./test/test.py
#include "include/lcd_ast.h"
#include "parser/lcd_idl.h"
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
int main(int argc, char ** argv)
{
if(argc != 2)
{
printf("error in number of args\n");
exit(0);
}
try
{
char * file = argv[1];
Scope * tree = (Scope *) Parser::parse(std::string(file));
printf("we have a tree\n");
}
catch (const Parser::ParseException e)
{
printf("caught an exception\n");
// std::cout << e.getReason();
exit(0);
}
}
#include "lcd_ast.h" #include "../include/lcd_ast.h"
#include "lcd_idl.h" #include "../include/lcd_idl.h"
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <iostream> #include <iostream>
int main(int argc, char ** argv) int main(int argc, char ** argv)
{ {
if(argc != 2) if(argc != 3)
{ {
printf("error in number of args\n"); printf("error in number of args\n");
exit(0); exit(0);
} }
try try
{ {
char * file = argv[1]; char * file = argv[2];
Scope * tree = (Scope *) Parser::parse(std::string(file)); Scope * tree = (Scope *) Parser::parse(std::string(file));
char* option = argv[1];
printf("option: %s\n", option);
printf("we have a tree\n"); printf("we have a tree\n");
} }
catch (const Parser::ParseException e) catch (const Parser::ParseException e)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment