1st version parsing for class diagrams

This commit is contained in:
knsv
2015-10-26 08:03:30 +01:00
parent dd6495abf6
commit 1a60b6e412
3 changed files with 73 additions and 6 deletions

View File

@@ -145,12 +145,12 @@ statement
classStatement
: CLASS className
| CLASS className STRUCT_START members STRUCT_STOP {/*console.log($2);*/}
| CLASS className STRUCT_START members STRUCT_STOP {/*console.log($2,JSON.stringify($4));*/yy.addMembers();}
;
members
: MEMBER { return $1; }
| MEMBER members { /*console.log('member: ',$1);*/}
: MEMBER { $$ = [$1]; }
| MEMBER members { $2.push($1);$$=$2;}
;
methodStatement

View File

@@ -93,13 +93,13 @@ case 8:
/*console.log('Label found',$$[$0]);*/
break;
case 12:
/*console.log($$[$0-3]);*/
console.log($$[$0-3],JSON.stringify($$[$0-1]));
break;
case 13:
return $$[$0];
this.$ = [$$[$0]];
break;
case 14:
/*console.log('member: ',$$[$0-1]);*/
$$[$0].push($$[$0-1]);this.$=$$[$0];
break;
case 15:
/*console.log('Rel found',$$[$0]);*/