I met this phrase when I read the specification of a computer language. And I would like to know what this phrase means.

For example:

The input stream is syntactically in error if the tokens in the stream of input elements parsed by a cover grammar cannot be parsed as a single instance of the corresponding supplemental goal symbol, with no tokens left over.

  • That entire sentence sounds mostly meaningless to me. – Jason Bassford Supports Monica Feb 27 '19 at 5:00
  • @JasonBassford Do you need concrete context? I can give link on full text of this. – MaximPro Feb 27 '19 at 5:03
  • I don't think it will matter. At best this is what I can make out of it: In any language, every word should have a purpose. – Jason Bassford Supports Monica Feb 27 '19 at 5:06
  • @JasonBassford ok, I'll keep it on mind :) – MaximPro Feb 27 '19 at 5:11

The original text is overly complex, and therefore quite difficult to put together.

However, in this context, the cover grammar refers to the generic "rule" (grammar) which defines how the stream of elements must be built.

If the stream is built correctly (good grammar), then it can be parsed and "understood" and no tokens will be left over.

If the stream in "grammatically" incorrect, then parsing cannot be done in such way as not to let tokens unparsed - and as such, the stream cannot be "understood" in its entirety.

|improve this answer|||||
  • For more context from the world of parsing, a "cover grammar" usually refers to a rule that can recognize multiple types of input, for later disambiguation. For example, trying to parse "a type or an expression" might be ambiguous in a particular language, so you might design a "cover grammar" that can accept either without knowing which one it is. Later analysis outside the parser could then determine which one it should be. – rpjohnst May 4 '19 at 20:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.