Lexical syntax reject indirection fails on 1 situation
lexical syntax
Keyword = BasicType
BasicType = “int8” //default: char
BasicType = “double” //default: 64 bitlexical 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
Submitted by Daco Harkes on 15 March 2013 at 11:01
(All template language)
Issue Log
What happens if you extract the rules for
ID
andKeyword
into SDF?
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 -> KeywordIdentifiers:
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
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 testIn 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.
closing barred issue
Log in to post comments