![]() The semantics of a program is what it means-that is, what it does when it executes. The syntax captures the legal expressions of the program-everything that in the custom-syntax DSL is captured by the grammar. When people discuss a programming language, you often hear them talk about syntax and semantics. All the DSL does is provide a readable way of populating that model-that is the difference from the command-query API I started with.įrom the DSL’s point of view, I refer to this model as the Semantic Model (159). Indeed you can say that most of the power of this design comes from having this model. The model is the engine that provides the behavior of the state machine. I would create a new event object (new Event("doorClosed", "D1CL")) and keep it to one side (in a Symbol Table (165)) so that when I see doorClosed => active I could include it in the transition (using addTransition). So, when I’m parsing the custom syntax version and come across: Events doorClosed D1CL In this example, the role of the DSL is to populate the state machine model. The presence of such a model, and its relationship with a DSL, are vitally important concerns. Learn More Buy 1.4 Languages and Semantic Model 1.4 Languages and Semantic ModelĪt the beginning of this example, I talked about building a model for a state machine.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |