lexical syntax
Keyword = BasicType
BasicType = “int8” //default: char
BasicType = “double” //default: 64 bit

lexical syntax
ID = [a-zA-Z_][0-9a-zA-Z_]*
ID = Keyword {reject}

The ID does allow double, but rejects int8 (and all other types).

If we add:

lexical syntax
Keyword = “double”

Then ID does not allow double anymore.

I am not sure what is the problem here, because double doesn’t work properly, but float, int8 etc do work properly.

Full syntax of BaseC
(All template language)

Submitted by Daco Harkes on 15 March 2013 at 11:01

On 15 March 2013 at 11:35 Gabriël Konat tagged parser

On 18 March 2013 at 01:42 Guido Wachsmuth commented:

What happens if you extract the rules for ID and Keyword into SDF?


On 20 March 2013 at 17:01 Daco Harkes commented:

They are generated into sdf always anyway. So why would it make a difference?

The real question is why double is not rejected right away, but int8 is.

Keywords:

module BaseC-Keywordsgenerated
exports
lexical syntax
BasicType -> Keyword

Identifiers:

module BaseC-Identifiersgenerated
exports
lexical syntax
[a-zA-Z_] [0-9a-zA-Z_]* -> ID
Keyword -> ID {reject}

Types:

module BaseC-Typesgenerated
exports
lexical syntax
“boolean” -> BasicType
“int8” -> BasicType
“int16” -> BasicType
“int32” -> BasicType
“int64” -> BasicType
“uint8” -> BasicType
“uint16” -> BasicType
“uint32” -> BasicType
“uint64” -> BasicType
“float” -> BasicType
“double” -> BasicType
“long” LAYOUT+ “double” -> BasicType
“string” -> BasicType


On 20 March 2013 at 17:05 Daco Harkes commented:

I added some more basic types just to test.

BasicType = “d1” //here to test
BasicType = “dou” //here to test
BasicType = “doub” //here to test
BasicType = “doubl” //here to test
BasicType = “doubla” //here to test
BasicType = “double1” //here to test
BasicType = “doublaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa” //here to test

In the corresponding testcases d1, dou and doub work fine. doubl, doubla and double1 do not work as expected (the same error as double).
doublaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, works fine again. real strange behaviour.

All other BasicTypes work fine too.


On 19 June 2014 at 20:36 Daco Harkes commented:

closing barred issue


On 19 June 2014 at 20:36 Daco Harkes closed this issue.


On 30 January 2015 at 15:04 Daco Harkes closed this issue.

Log in to post comments