Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int exprOr(){
- if(exprAnd()){
- if(exprOr1())
- return 1;
- }
- return 0;
- }
- int exprOr1(){
- if(consume(OR)){
- if(exprAnd()){
- if(exprOr1())
- return 1;
- }else
- tkerr("Invalid fct after ||");
- }
- return 1;
- }
- int exprAnd(){
- if(exprEq()){
- if(exprAnd1())
- return 1;
- }
- return 0;
- }
- int exprAnd1(){
- if(consume(AND)){
- if(exprEq()){
- if(exprAnd1())
- return 1;
- }else
- tkerr("Invalid fct after ||");
- }
- return 1;
- }
- int exprEq(){
- if(exprRel()){
- if(exprEq1())
- return 1;
- }
- return 0;
- }
- int exprEq1(){
- if(consume(EQUAL) || consume(NOTEQ)){
- if(exprRel()){
- if(exprEq1())
- return 1;
- }else
- tkerr("Invalid fct after ||");
- }
- return 1;
- }
- int exprRel(){
- if(exprAdd()){
- if(exprRel1())
- return 1;
- }
- return 0;
- }
- int exprRel1(){
- if(consume(LESS) || consume(LESSEQ) || consume(GREATER) || consume(GREATEREQ)){
- if(exprAdd()){
- if(exprRel1())
- return 1;
- }else
- tkerr("Invalid fct after ||");
- }
- return 1;
- }
- int exprAdd(){
- if(exprMul()){
- if(exprAdd1())
- return 1;
- }
- return 0;
- }
- int exprAdd1(){
- if(consume(ADD) || consume(SUB)){
- if(exprMul()){
- if(exprAdd1())
- return 1;
- }else
- tkerr("Invalid fct after ||");
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement