tailieunhanh - Beginning SQL Server Modeling- P3

Tham khảo tài liệu 'beginning sql server modeling- p3', công nghệ thông tin, cơ sở dữ liệu phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | CHAPTER 3 DOMAIN-SPECIFIC LANGUAGES 101 LOLA S LUNCH COUNTER Figure3-10. Interleaving whitespace Lola So you re pretty much back to where you started. I need something that s going to work with more than pastrami on rye How are you going to get there from here Norm Right. So how do you define a sandwich anyway At the simplest level it s some kind of lunchmeat on some kind of bread. So let s change the main syntax definition to something like that. Norm changes the DSL Grammar code to reflect his thinking along the lines shown in Figure 3-11. Of course the grammar processor center pane has no idea what the terms Lunchmeat and Bread are because they are undefined. Defining Tokens Figure 3-11. First cut at making the SandwichOrders syntax rule more general Norm has redefined the Main syntax but now he needs to define Lunchmeat and Bread as tokens. To get started he d like the processor to accept any string for Lunchmeat followed by the preposition on and any string for Bread with a period at the end. Right now anything from foo on bar to Brecht on Brecht would mean some progress in Lola s eyes. So Norm adds a couple of token statements to the grammar definition to define Lunchmeat and Bread as tokens within the grammar that can contain any sequence of characters. Figure 3-12 shows the result. Again the grammar works with this and shows no error. The two token statements define Lunchmeat and Bread in exactly the same way They can be a single contiguous string of 41 Download from Wow eBook CHAPTER 3 DOMAIN-SPECIFIC LANGUAGES 101 LOLA S LUNCH COUNTER one or more characters a through z or A through Z. But I ve introduced a number of new M language forms a . z means a single alpha character anywhere in the range from a to z. Similarly A . Z means a single capitalized alpha character anywhere in the range from A to Z. A pipe character I is the logical OR operator. A plus sign is a postfix Kleene operator meaning one or more of this entity. So given this .

TỪ KHÓA LIÊN QUAN