Write grammar automatically using dyacc

I’m doing my task about compiler project. I’m using Lex and Yacc for Delphi tools. I am unclear about how to generate grammar automatically using dyacc tools. I want to make a parse tree from source code input, but I don’t know how to use a grammar to make a parse tree. I’ve already made it manually, but not clearly true for parsing.

These are the steps of my task:

source code -> lexical (token) -> syntax -> parse-tree

PS: I’m using Java source code as input, but I’m making the compiler project in Delphi.

Source: syntax

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.