Closed yanhick closed 9 years ago
The version I have is 1.2.0.1
Even for me, it sometimes generates those List types. At that time, I revert those changes... quit my IDE completely (not just closing the project) & relaunch it and try the same operation - it generates properly... weird but worked so far.
I use same version
Weird bug, I have the same with 1.2.0.1, do you have the same issue @as3boyan ?
no, @yanhick
@sganapavarapu1, are you sure that when you relaunch the IDE, GrammarKit just skips compilation since "gen" already exists ? What happens if you remove "gen" before restarting the IDE ?
@yanhick If I delete "gen" - get same issue.
thanks, do you guys think that the generated "List" make sense given the current state of the BNF ? I don't understand enough about it to know.
Perhaps typeTag
may have multiple function types, each function type may be corresponding to type or anonymous
@yanhick
I removed the "gen" directory and restarted my IDE - then regenerated the sources & rebuilt... I did 'not' run into the List issue. So, it seems that pre-existing "gen" directory isn't the issue.
FYI, I happened to find out in past, confirmedly - that, entries in idea.vmoptions in your $IDEA_INSTALL_DIR/bin also influences what's generated.
e.g. this is what I have in my idea.vmoptions
-ea -server -Xms1g -Xmx2g -Xss16m -XX:PermSize=256m -XX:MaxPermSize=512m -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:+UseAdaptiveGCBoundary -XX:+HeapDumpOnOutOfMemoryError -XX:+CMSClassUnloadingEnabled -XX:+CMSParallelRemarkEnabled -XX:CMSInitiatingOccupancyFraction=60 -XX:+UseSplitVerifier -XX:CompileThreshold=10000 -Dsun.io.useCanonCaches=false -Djava.net.preferIPv4Stack=true -Djsse.enableSNIExtension=false -Dawt.useSystemAAFontSettings=lcd
Earlier, I used to have something similar to what Adolfo's comments have (at this URL): https://intellij-support.jetbrains.com/entries/23395793-Configuring-JVM-options-and-platform-properties
e.g. some of these affect how grammar kit generates code:
-XX:+UseFastAccessorMethods
-XX:+UnlockDiagnosticVMOptions
-XX:+UnlockExperimentalVMOptions
-XX:+UseCompressedOops
-XX:+OptimizeStringConcat
-XX:+UseStringCache
-XX:+UseCodeCacheFlushing
even with stabler older versions of grammar kit.
I did find another problem though - when I removed my "gen" ... following files were not regenerated!
deleted: gen/com/intellij/plugins/haxe/hxml/HXMLParser.java
deleted: gen/com/intellij/plugins/haxe/hxml/psi/HXMLClasspath.java
deleted: gen/com/intellij/plugins/haxe/hxml/psi/HXMLDefine.java
deleted: gen/com/intellij/plugins/haxe/hxml/psi/HXMLLib.java
deleted: gen/com/intellij/plugins/haxe/hxml/psi/HXMLMain.java
deleted: gen/com/intellij/plugins/haxe/hxml/psi/HXMLProperty.java
deleted: gen/com/intellij/plugins/haxe/hxml/psi/HXMLQualifiedName.java
deleted: gen/com/intellij/plugins/haxe/hxml/psi/HXMLTypes.java
deleted: gen/com/intellij/plugins/haxe/hxml/psi/HXMLVisitor.java
deleted: gen/com/intellij/plugins/haxe/hxml/psi/impl/HXMLClasspathImpl.java
deleted: gen/com/intellij/plugins/haxe/hxml/psi/impl/HXMLDefineImpl.java
deleted: gen/com/intellij/plugins/haxe/hxml/psi/impl/HXMLLibImpl.java
deleted: gen/com/intellij/plugins/haxe/hxml/psi/impl/HXMLMainImpl.java
deleted: gen/com/intellij/plugins/haxe/hxml/psi/impl/HXMLPropertyImpl.java
deleted: gen/com/intellij/plugins/haxe/hxml/psi/impl/HXMLQualifiedNameImpl.java
deleted: gen/com/intellij/plugins/haxe/lang/psi/HaxeConstructorName.java
deleted: gen/com/intellij/plugins/haxe/lang/psi/HaxeMacroMeta.java
I had to get them from git-hub repo.
@sganapavarapu1 They should be generated if you open hxml.bnf and trigger grammar generation for it
Thanks guys. @as3boyan, we just discussed this at our standup, we'll file a bug on the GrammarKit project to ask why those extra List are generated.
@as3boyan Thanks,
Grammar-kit bug was filed: https://github.com/JetBrains/Grammar-Kit/issues/60
BTW, Grammar-Kit 1.1.x still works and doesn't have this bug.
@EBatTiVo, @as3boyan, when I generate the haxe and hxml parsers from the command-line, I get differences in the types generated, a lot of them are wrapped in List.
For example HaxeBlockStatement becomes List.
I'm guessing this is because I don't use the right version of GrammarKit, I'm using 1.2.0, could you tell me which one do you use ? Thanks