Call for help! YACC, Go, SVG, Feedback

Call for help! YACC, Go, SVG, Feedback

Hi everyone,

I started a project a while ago on (github) and I felt kinda stuck at one stage, so I decided to fire of a call for help here to proceed with this project – cause I feel this would be helpful for more people than just me.

This project has no documentation for now by intention, cause it's in a very early development stage and I didn't want to raise any attention before it's usable. So here a small description what it's supposed to be.

About tdoc

tdoc is supposed to generate SVG pictures from text – the source for the big picture are actually plain SVG files (like the official iconset from AWS, Azure or whatever). If you want to generate an AWS documentation, it should be as easy as that:

sns foo -> lambda bar 

This will take the picture "sns.svg", labels it with foo and draws a relation to the bar labeled "lambda.svg". Fair enough, the problem is, it should be very flexible to also support input like this:

dc datacenter1 { ec2 foo { docker my_container1 } } dc datacenter2 { ec2 bar { docker my_container2 } } 

So therefor I decided to use YACC.

Current state of the project

tdoc is able to render something like this correct: dc datacenter1 { ec2 foo lambda bar sns blubb }

Imgur The biggest issue I'm facing currently, is the grammar for the multi-nested components. Rendering the images nested on many layers does work – but the parsing of the initial input is still an issue.


cloud foo { vpc bar client blubb APIGateway baz CloudWatch_alarm quo CloudSearch blubbb DynamoDB_item bazz MachineLearning test { EC2_instance bar1 EC2_instance bar2 EC2_instance bar3 EC2_instances bar4 EC2_instances bar5 EC2_instances bar6 OpsWorks_instances bar7 RDS_RDSDBinstance bar8 RDS_OracleDBinstancealternate bar9 } } 

The smallest samle that doesn't work: Imgur

cloud foo { vpc bar { EC2_Instance blubb } vpc baz { EC2_Instance quo } } 

The source for this problem is actually the design of the grammar – but since I've absolutely no experience with YACC (beside what I've learned so far while working on tdoc), I'd really like to get some help and a review of the grammar. The relations are not yet build into the grammar, since the nesting is causing me so much pain.

Try it yourself

After you go-get'ed tdoc, you can try it yourself with just putting any random svg in a folder (like test.svg) and run it with: tdoc -s /home/foo/svg input.tdoc

And input.tdoc would look like: test foo

Any feedback, review, support, PR, chat – whatever would be welcome!

Submitted August 14, 2017 at 12:30AM by ducky_cloud
via reddit


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s