This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/******************************************************************************* | |
* Copyright (c) 2015 itemis AG (http://www.itemis.eu) and others. | |
* All rights reserved. This program and the accompanying materials | |
* are made available under the terms of the Eclipse Public License v1.0 | |
* which accompanies this distribution, and is available at | |
* http://www.eclipse.org/legal/epl-v10.html | |
*******************************************************************************/ | |
package org.eclipse.xtext.example.domainmodel.view | |
import com.google.common.collect.ImmutableList |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/******************************************************************************* | |
* Copyright (c) 2015 itemis AG (http://www.itemis.eu) and others. | |
* All rights reserved. This program and the accompanying materials | |
* are made available under the terms of the Eclipse Public License v1.0 | |
* which accompanies this distribution, and is available at | |
* http://www.eclipse.org/legal/epl-v10.html | |
*******************************************************************************/ | |
package org.eclipse.xtext.example.domainmodel.ui.contentassist | |
import com.google.inject.Inject |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link rel="stylesheet" type="text/css" href="xtext/2.9.0.beta2/xtext.css"/> | |
<script src="webjars/requirejs/2.1.17/require.min.js"></script> | |
<script type="text/javascript"> | |
require.config({ | |
paths: { | |
"text": "webjars/requirejs-text/2.0.10-3/text", | |
"jquery": "webjars/jquery/2.1.4/jquery.min", | |
"xtext/xtext": "xtext/2.9.0.beta2/xtext" | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Person { | |
name: string | |
bag: Bag | |
getCash(): number { | |
bag.wallet.cash | |
} | |
} | |
class Bag { | |
wallet: Wallet | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override void doGenerate(Resource resource, IFileSystemAccess2 fsa, IGeneratorContext context) { | |
val model = resource.contents.head as Model | |
val baseName = resource.baseName | |
fsa.generateTracedFile(baseName + '.h', model, ''' | |
/******************************** | |
* Header file for «resource.URI.lastSegment» | |
*/ | |
#ifndef «baseName.toUpperCase»_H | |
#define «baseName.toUpperCase»_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Traced protected def generateHeader(ClassDeclaration it) ''' | |
/* | |
* Declaration of «name» class | |
*/ | |
struct _«_name» | |
{ | |
«FOR p : members.filter(Property)» | |
/* Property «name».«p.name» */ | |
«generateDeclaration(p)» | |
«ENDFOR» |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@TracedAccessors(MyDslFactory) | |
class MyDslTraceExtensions { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val n = trace(expression) | |
val receiverVar = expression.receiver?.generateExpression(n, scope) | |
val resultVar = scope.nextVarName | |
n.append(generateType(expression.feature?.type)) | |
n.append(' ') | |
n.append(resultVar) | |
... | |
n.append(' = ') | |
n.append(receiverVar ?: 'this') | |
n.append('->') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Bag* __local_0 = this->bag; | |
Wallet* __local_1 = __local_0->wallet; | |
double __local_2 = __local_1->cash; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const ScopeComputationKey: BindingKey<ScopeComputation> = { id: 'ScopeComputation' }; | |
export class ScopeComputation implements DIService { | |
private nameProvider: NameProvider; | |
initialize(services: ServiceHolder): void { | |
this.nameProvider = services.get(NameProvider); | |
} |
OlderNewer