diff --git a/makefile b/makefile index 21bb601..beeff76 100644 --- a/makefile +++ b/makefile @@ -29,5 +29,6 @@ test:nasal ./nasal -t test/quick_sort.nas ./nasal test/scalar.nas ./nasal test/trait.nas + ./nasal -t test/turingmachine.nas ./nasal -t test/ycombinator.nas \ No newline at end of file diff --git a/nasal_ast.h b/nasal_ast.h index 26601d6..ed5530c 100644 --- a/nasal_ast.h +++ b/nasal_ast.h @@ -138,7 +138,7 @@ public: nasal_ast(const uint32_t l=0,const uint32_t t=ast_null):_line(l),_type(t){} nasal_ast(const nasal_ast&); nasal_ast(nasal_ast&&); - void print(const int); + void print(int,bool); void clear(); nasal_ast& operator=(const nasal_ast&); @@ -209,10 +209,11 @@ void nasal_ast::clear() _child.clear(); } -void nasal_ast::print(const int depth) +void nasal_ast::print(int depth,bool last=false) { - for(int i=0;i intentation={}; + for(auto& i:intentation) + std::cout<>3)==0?0:((line>>3)<<3); end=(1+(line>>3))<<3; for(uint32_t i=begin;i'); + state=action[4]; + break; + } + prt(state,pointer,paper,action); + } +} + +run(table,{},'q0','q3'); \ No newline at end of file