Close

Implementation

A project log for CDL - Circuit Description Language

An improved hardware description language.

reed-fosterReed Foster 01/05/2018 at 04:520 Comments

Once I had a first revision of the language grammar formally specified, I broke out the Python. One of the differences I quickly noticed between lexical analysis of my language and of logical expressions is that there are a lot of symbols that need to be detected, many of them having varying lengths, and even some having the same start character. I (incorrectly/unnecessarily) decided that I needed to differentiate between two tokens that look identical but have different meanings depending on their context. The signal assignment and less than or equal to operators are both "<=" strings, but they don't mean the same thing. What I didn't really stop to think about was the fact that the semantics of the token don't matter in the lexical analysis phase of compilation, and that I could use a single token type to identify both signal assignment and less than or equal to operators. Oh well.

Discussions