Advanced
Domain Specific Language Parser Implementation
Design and implement a parser and interpreter for a simple Domain Specific Language (DSL) for defining automation workflows.
📝 Prompt Content
Design a simple DSL that allows users to define automation workflows consisting of triggers (schedule, event) and actions (send email, write log). Define the formal grammar (BNF) for this language. Implement a lexer and recursive descent parser in Python or JavaScript that transforms source code into an Abstract Syntax Tree (AST). Finally, implement an interpreter that traverses the AST and executes the defined actions. Discuss how you would handle error reporting and syntax errors gracefully.