Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance generated rules coding style #84

Open
MartinLoeper opened this issue Aug 31, 2017 · 2 comments
Open

Enhance generated rules coding style #84

MartinLoeper opened this issue Aug 31, 2017 · 2 comments

Comments

@MartinLoeper
Copy link
Owner

The generated rules are not clear. This is caused by canonical names for the lookups instead of simple class names being used.

Replace the canonical names by simple names. In order to do this, replace the xTend FOR loop with a java one in order to used the guillemets as usual.

@MartinLoeper
Copy link
Owner Author

I should talk to Dominik because I do not know how to call the code inside:

«FOR x : rule.lookups»
    «x.generateCodeForRule(theClass)»
«ENDFOR»

The method generateCodeForRule(theClass) uses expressions like this: «Stream.canonicalName».
I do not know how to use guillemets because it calls .toString() twice which is not what I expect.

@MartinLoeper
Copy link
Owner Author

I found the reason in the Java sources which are generated out of the xTend sources:

    EList<Lookup> _lookups = rule.getLookups();
    for(final Lookup x : _lookups) {
      CharSequence _generateCodeForRule = KampRuleLanguageJvmModelInferrer.this.generateCodeForRule(x, theClass);
      _builder.append(_generateCodeForRule);
      _builder.newLineIfNotEmpty();
    }

However I do not know how to instruct the StringConcatenationClient generation to split the result of the method invocation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant