{"action":"created","issue":{"url":"https://api.github.com/repos/johnmartel/javaccPlugin/issues/16","labels_url":"https://api.github.com/repos/johnmartel/javaccPlugin/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/johnmartel/javaccPlugin/issues/16/comments","events_url":"https://api.github.com/repos/johnmartel/javaccPlugin/issues/16/events","html_url":"https://github.com/johnmartel/javaccPlugin/issues/16","id":96333794,"number":16,"title":"JJTree and custom classes","user":{"login":"jponge","id":25961,"avatar_url":"https://avatars.githubusercontent.com/u/25961?v=3","gravatar_id":"","url":"https://api.github.com/users/jponge","html_url":"https://github.com/jponge","followers_url":"https://api.github.com/users/jponge/followers","following_url":"https://api.github.com/users/jponge/following{/other_user}","gists_url":"https://api.github.com/users/jponge/gists{/gist_id}","starred_url":"https://api.github.com/users/jponge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jponge/subscriptions","organizations_url":"https://api.github.com/users/jponge/orgs","repos_url":"https://api.github.com/users/jponge/repos","events_url":"https://api.github.com/users/jponge/events{/privacy}","received_events_url":"https://api.github.com/users/jponge/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/johnmartel/javaccPlugin/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":{"login":"johnmartel","id":3068511,"avatar_url":"https://avatars.githubusercontent.com/u/3068511?v=3","gravatar_id":"","url":"https://api.github.com/users/johnmartel","html_url":"https://github.com/johnmartel","followers_url":"https://api.github.com/users/johnmartel/followers","following_url":"https://api.github.com/users/johnmartel/following{/other_user}","gists_url":"https://api.github.com/users/johnmartel/gists{/gist_id}","starred_url":"https://api.github.com/users/johnmartel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnmartel/subscriptions","organizations_url":"https://api.github.com/users/johnmartel/orgs","repos_url":"https://api.github.com/users/johnmartel/repos","events_url":"https://api.github.com/users/johnmartel/events{/privacy}","received_events_url":"https://api.github.com/users/johnmartel/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/johnmartel/javaccPlugin/milestones/8","html_url":"https://github.com/johnmartel/javaccPlugin/milestones/2.2.2","labels_url":"https://api.github.com/repos/johnmartel/javaccPlugin/milestones/8/labels","id":1242483,"number":8,"title":"2.2.2","description":"","creator":{"login":"johnmartel","id":3068511,"avatar_url":"https://avatars.githubusercontent.com/u/3068511?v=3","gravatar_id":"","url":"https://api.github.com/users/johnmartel","html_url":"https://github.com/johnmartel","followers_url":"https://api.github.com/users/johnmartel/followers","following_url":"https://api.github.com/users/johnmartel/following{/other_user}","gists_url":"https://api.github.com/users/johnmartel/gists{/gist_id}","starred_url":"https://api.github.com/users/johnmartel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnmartel/subscriptions","organizations_url":"https://api.github.com/users/johnmartel/orgs","repos_url":"https://api.github.com/users/johnmartel/repos","events_url":"https://api.github.com/users/johnmartel/events{/privacy}","received_events_url":"https://api.github.com/users/johnmartel/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":1,"state":"closed","created_at":"2015-08-05T17:30:27Z","updated_at":"2015-08-06T23:53:24Z","due_on":null,"closed_at":"2015-08-06T23:53:24Z"},"comments":5,"created_at":"2015-07-21T14:39:34Z","updated_at":"2015-08-10T10:08:42Z","closed_at":"2015-08-05T17:50:19Z","body":"I find using the support for custom classes with JJTree difficult.\r\n\r\nBased on the current layout of `org.eclipse.golo`, I tried making a rudimentary Gradle build.\r\n\r\nMy Gradle build contains:\r\n\r\n```groovy\r\nplugins {\r\n  id \"ca.coglinc.javacc\" version \"2.2.0\"\r\n}\r\n\r\n(...)\r\n\r\ncompileJavacc {\r\n  include '**/*.java'\r\n}\r\n```\r\n\r\nThe `.jjt` file that I am using with Maven sits under `src/main/jjtree`. I now have moved it to its package namespace, thinking that perhaps this would help the plugin find my custom classes (they sit under `src/main/java`):\r\n\r\n```\r\nsrc/main/jjtree/\r\n└── fr\r\n    └── insalyon\r\n        └── citi\r\n            └── golo\r\n                └── compiler\r\n                    └── parser\r\n                        └── Golo.jjt\r\n```\r\n\r\nThis didn't work much better, so I moved the custom classes (a package actually) to `src/main/javacc`:\r\n\r\n```\r\nsrc/main/javacc\r\n└── fr\r\n    └── insalyon\r\n        └── citi\r\n            └── golo\r\n                └── compiler\r\n                    └── parser\r\n                        ├── ASTAdditiveExpression.java\r\n                        ├── ASTAndExpression.java\r\n                        ├── ASTAnonymousFunctionInvocation.java\r\n                        ├── ASTArgument.java\r\n                        ├── ASTAssignment.java\r\n                        ├── ASTAugmentDeclaration.java\r\n                        ├── ASTBlock.java\r\n                        ├── ASTBreak.java\r\n                        ├── ASTCase.java\r\n                        ├── ASTCollectionLiteral.java\r\n                        ├── ASTConditionalBranching.java\r\n                        ├── ASTContinue.java\r\n                        ├── ASTDecoratorDeclaration.java\r\n                        ├── ASTDestructuringAssignment.java\r\n                        ├── ASTEqualityExpression.java\r\n                        ├── ASTForEachLoop.java\r\n                        ├── ASTForLoop.java\r\n                        ├── ASTFunction.java\r\n                        ├── ASTFunctionDeclaration.java\r\n                        ├── ASTFunctionInvocation.java\r\n                        ├── ASTImportDeclaration.java\r\n                        ├── ASTInvocationExpression.java\r\n                        ├── ASTLetOrVar.java\r\n                        ├── ASTLiteral.java\r\n                        ├── ASTMethodInvocation.java\r\n                        ├── ASTModuleDeclaration.java\r\n                        ├── ASTMultiplicativeExpression.java\r\n                        ├── ASTNamedAugmentationDeclaration.java\r\n                        ├── ASTOrExpression.java\r\n                        ├── ASTOrIfNullExpression.java\r\n                        ├── ASTReference.java\r\n                        ├── ASTRelationalExpression.java\r\n                        ├── ASTReturn.java\r\n                        ├── ASTStructDeclaration.java\r\n                        ├── ASTThrow.java\r\n                        ├── ASTTryCatchFinally.java\r\n                        ├── ASTUnaryExpression.java\r\n                        ├── ASTUnionDeclaration.java\r\n                        ├── ASTUnionValue.java\r\n                        ├── ASTWhileLoop.java\r\n                        ├── GoloASTNode.java\r\n                        ├── GoloOffsetParser.java\r\n                        ├── GoloOffsetParserTokenManager.java\r\n                        ├── GoloTokenBase.java\r\n                        ├── JavaOffsetCharStream.java\r\n                        ├── NamedNode.java\r\n                        └── package-info.java\r\n```\r\n\r\nAnd then the build fails, because it tries copying a generated file to itself :smiley: \r\n\r\n```\r\n$ ./gradlew clean compileJava\r\n:clean\r\n:compileJjtree\r\nJava Compiler Compiler Version 6.1_2 (Tree Builder)\r\n(type \"jjtree\" with no arguments for help)\r\nReading from file /Users/jponge/Code/gololang/src/main/jjtree/fr/insalyon/citi/golo/compiler/parser/Golo.jjt . . .\r\nWarning: Output directory \"/Users/jponge/Code/gololang/build/generated/jjtree/fr/insalyon/citi/golo/compiler/parser\" does not exist. Creating the directory.\r\nopt:java\r\nFile \"Node.java\" does not exist.  Will create one.\r\nFile \"SimpleNode.java\" does not exist.  Will create one.\r\nFile \"ASTerror.java\" does not exist.  Will create one.\r\nFile \"ASTCompilationUnit.java\" does not exist.  Will create one.\r\nFile \"ASTModuleDeclaration.java\" does not exist.  Will create one.\r\nFile \"ASTImportDeclaration.java\" does not exist.  Will create one.\r\nFile \"ASTToplevelDeclaration.java\" does not exist.  Will create one.\r\nFile \"ASTStructDeclaration.java\" does not exist.  Will create one.\r\nFile \"ASTUnionValue.java\" does not exist.  Will create one.\r\nFile \"ASTUnionDeclaration.java\" does not exist.  Will create one.\r\nFile \"ASTNamedAugmentationDeclaration.java\" does not exist.  Will create one.\r\nFile \"ASTAugmentDeclaration.java\" does not exist.  Will create one.\r\nFile \"ASTFunctionDeclaration.java\" does not exist.  Will create one.\r\nFile \"ASTDecoratorDeclaration.java\" does not exist.  Will create one.\r\nFile \"ASTContinue.java\" does not exist.  Will create one.\r\nFile \"ASTBreak.java\" does not exist.  Will create one.\r\nFile \"ASTThrow.java\" does not exist.  Will create one.\r\nFile \"ASTWhileLoop.java\" does not exist.  Will create one.\r\nFile \"ASTForLoop.java\" does not exist.  Will create one.\r\nFile \"ASTForEachLoop.java\" does not exist.  Will create one.\r\nFile \"ASTTryCatchFinally.java\" does not exist.  Will create one.\r\nFile \"ASTExpressionStatement.java\" does not exist.  Will create one.\r\nFile \"ASTUnaryExpression.java\" does not exist.  Will create one.\r\nFile \"ASTInvocationExpression.java\" does not exist.  Will create one.\r\nFile \"ASTMultiplicativeExpression.java\" does not exist.  Will create one.\r\nFile \"ASTAdditiveExpression.java\" does not exist.  Will create one.\r\nFile \"ASTRelationalExpression.java\" does not exist.  Will create one.\r\nFile \"ASTEqualityExpression.java\" does not exist.  Will create one.\r\nFile \"ASTAndExpression.java\" does not exist.  Will create one.\r\nFile \"ASTOrExpression.java\" does not exist.  Will create one.\r\nFile \"ASTOrIfNullExpression.java\" does not exist.  Will create one.\r\nFile \"ASTMethodInvocation.java\" does not exist.  Will create one.\r\nFile \"ASTBlock.java\" does not exist.  Will create one.\r\nFile \"ASTFunction.java\" does not exist.  Will create one.\r\nFile \"ASTLiteral.java\" does not exist.  Will create one.\r\nFile \"ASTCollectionLiteral.java\" does not exist.  Will create one.\r\nFile \"ASTReference.java\" does not exist.  Will create one.\r\nFile \"ASTDestructuringAssignment.java\" does not exist.  Will create one.\r\nFile \"ASTLetOrVar.java\" does not exist.  Will create one.\r\nFile \"ASTAssignment.java\" does not exist.  Will create one.\r\nFile \"ASTReturn.java\" does not exist.  Will create one.\r\nFile \"ASTArgument.java\" does not exist.  Will create one.\r\nFile \"ASTAnonymousFunctionInvocation.java\" does not exist.  Will create one.\r\nFile \"ASTFunctionInvocation.java\" does not exist.  Will create one.\r\nFile \"ASTConditionalBranching.java\" does not exist.  Will create one.\r\nFile \"ASTCase.java\" does not exist.  Will create one.\r\nFile \"ASTMatch.java\" does not exist.  Will create one.\r\nFile \"GoloParserTreeConstants.java\" does not exist.  Will create one.\r\nFile \"GoloParserVisitor.java\" does not exist.  Will create one.\r\nFile \"GoloParserDefaultVisitor.java\" does not exist.  Will create one.\r\nFile \"JJTGoloParserState.java\" does not exist.  Will create one.\r\nAnnotated grammar generated successfully in /Users/jponge/Code/gololang/build/generated/jjtree/fr/insalyon/citi/golo/compiler/parser/Golo.jj\r\n:compileJavacc\r\nJava Compiler Compiler Version 6.1_2 (Parser Generator)\r\n(type \"javacc\" with no arguments for help)\r\nReading from file /Users/jponge/Code/gololang/build/generated/jjtree/fr/insalyon/citi/golo/compiler/parser/Golo.jj . . .\r\nWarning: Output directory \"/Users/jponge/Code/gololang/build/generated/javacc/tmp/fr/insalyon/citi/golo/compiler/parser\" does not exist. Creating the directory.\r\nNote: UNICODE_INPUT option is specified. Please make sure you create the parser/lexer using a Reader with the correct character encoding.\r\nFile \"TokenMgrError.java\" does not exist.  Will create one.\r\nFile \"ParseException.java\" does not exist.  Will create one.\r\nFile \"Token.java\" does not exist.  Will create one.\r\nFile \"JavaCharStream.java\" does not exist.  Will create one.\r\nParser generated with 0 errors and 1 warnings.\r\n:compileJavacc FAILED\r\n\r\nFAILURE: Build failed with an exception.\r\n\r\n* What went wrong:\r\nExecution failed for task ':compileJavacc'.\r\n> Could not copy file /Users/jponge/Code/gololang/build/generated/jjtree/fr/insalyon/citi/golo/compiler/parser/ASTAdditiveExpression.java to /Users/jponge/Code/gololang/build/generated/jjtree/fr/insalyon/citi/golo/compiler/parser/ASTAdditiveExpression.java\r\n\r\n* Try:\r\nRun with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.\r\n\r\nBUILD FAILED\r\n\r\nTotal time: 3.049 secs\r\n```\r\n\r\nAny idea of where I'm wrong?\r\n\r\nThanks!"},"comment":{"url":"https://api.github.com/repos/johnmartel/javaccPlugin/issues/comments/129394503","html_url":"https://github.com/johnmartel/javaccPlugin/issues/16#issuecomment-129394503","issue_url":"https://api.github.com/repos/johnmartel/javaccPlugin/issues/16","id":129394503,"user":{"login":"jponge","id":25961,"avatar_url":"https://avatars.githubusercontent.com/u/25961?v=3","gravatar_id":"","url":"https://api.github.com/users/jponge","html_url":"https://github.com/jponge","followers_url":"https://api.github.com/users/jponge/followers","following_url":"https://api.github.com/users/jponge/following{/other_user}","gists_url":"https://api.github.com/users/jponge/gists{/gist_id}","starred_url":"https://api.github.com/users/jponge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jponge/subscriptions","organizations_url":"https://api.github.com/users/jponge/orgs","repos_url":"https://api.github.com/users/jponge/repos","events_url":"https://api.github.com/users/jponge/events{/privacy}","received_events_url":"https://api.github.com/users/jponge/received_events","type":"User","site_admin":false},"created_at":"2015-08-10T10:08:41Z","updated_at":"2015-08-10T10:08:41Z","body":":+1: many thanks @johnmartel :smiley: "}}