[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Is & a command?
In addition to Michael's comment, I think Roger is making the mistake of treating a specific for a universal. "The [ is actually the name of the command" is not a universal statement that all [ are commands, or that all opening delimiters are commands, but a specific statement that in the particular shell they are implemented/treated/equivalent as commands. The scope of the statement is that particular language's implementation or design (and perhaps its "denotational semantics".) It is as wrongheaded as would be "English has prepositions, so is the XML & delimiter a preposition?" On the other hand, if Roger is asking "Is it possible to write a parser for XML in which each delimiter is used as the 'name' of a 'command' used to parse the next section after it?" then the answer is yes: there are several classes of parsers that can be implemented like that (e.g. some of bottom up, shift-reduce, PEG, etc.) Loosely, a top-down parser says "I am looking now for z, y or z" while a bottom-up parser say "I am presented now with a z: what are the ramifications?" So in the bottom-up case, you could regard of the z as (the name of) a command, if it helped. (The threaded interpreted languages like Forth work like that, IIRC: there is no distinct scanner, so a new command could be added just using any unique character.) Parsers can be implemented accepting grammars, or by hardcoding, and by everything in between. (The fundamental implementation issue is not whether a lexical token is treated as a string, a message, a method name, a command, or whatever, but whether your implementation needs a stack or not: a stack is not required to parse XML text, but it is needed one to judge well-formedness.) Regards Rick On Mon, Nov 14, 2022 at 8:53 PM Roger L Costello <costello@mitre.org> wrote:
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] |
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|