BNF questions and comments
BLS
nanali at nospam-wanadoo.fr
Fri Sep 7 09:25:37 PDT 2007
Yep. Porting Walter's language/grammar description into EBNF is a
challenge. You may have recognized that I am working on Netbeans IDE
support for D/MiniD... in order to establish code folding I have to
create an NBS Schliemann file which is (mostly) similar to EBNF.
Instead of {} I have to use ()*, in fact a few minor things.
Probabely we can exchange some information ?
Bjoern
BCS schrieb:
> under LinkageType what (from a lexical standpoint) are C, C++, D, etc?
>
> ===
> under Conditional Compilation:
>
> ConditionalDeclaration:
> Condition : Declarations
>
> Condition:
> StaticIfCondition
>
> StaticIfCondition:
> static if ( AssignExpression )
>
> allowing this:
>
> static if(0==0) : int i;
>
> Is this supposed to work? If so what for?
>
> ===
> BaseClassList under NewExpression uses a lowercase for the L in list
> where an upper case is used where it is defined.
>
> ===
> What about with:
>
> ClassTemplateDeclaration:
> class Identifier ( TemplateParameterList ) [SuperClass {,
> InterfaceClass }] ClassBody
>
> why isn't BaseClassList used?
>
> this as far as I can tell BaseClassList doesn't require a comma (but dmd
> doesn't let you drop it) and the above grammar requires a base class
> before interfaces (and DMD doesn't require this)
>
> ===
> CatchParameter ExpressionList
> FunctionParameterList
> ModuleAliasIdentifier
> TemplateIdentifier
> Tuple
> IntegerExpression (in iasm.html)
>
> ===
> are not defined
>
> ClassTemplateDeclaration
> FunctionTemplateDeclaration
> ConditionalDeclaration
> TemplateMixin
> TemplateDeclaration
> StaticAssert
>
> are never used
>
> ===
> LabelledStatement is misspelled in it's definition
>
> ===
> The format of the bnf section is not consistent. Off hand:
> -many productions are missing the :
> -in most cases operators are unquote but in a few they are
> -opt is used in a few cases but general omitted in favor of other choices
> -grouping is used in 1 or 2 cases but again is generally not used.
> -in two(?) places the "empty" production is used.
>
> this all comes from extracting the grammar from the docs. I would like
> to be able to automate this but having these discrepancies requires that
> I do it by hand.
>
>
More information about the Digitalmars-d-learn
mailing list