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
import * as net from 'net'; | |
import * as vscode from 'vscode'; | |
import { LanguageClient, LanguageClientOptions, ServerOptions, StreamInfo } from 'vscode-languageclient'; | |
const DEBUG = false; | |
const SERVER_PORT = 5008; | |
export function activate(context: vscode.ExtensionContext) { | |
const languageClient = DEBUG | |
? getSocketLanguageClient({ serverPort: SERVER_PORT }) |
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); | |
} |
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
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
@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
@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
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
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
grammar org.xtext.example.home.HomeAutomation with org.eclipse.xtext.common.Terminals | |
generate homeAutomation "http://www.xtext.org/example/home/HomeAutomation" | |
//--- Model Example | |
// Device Window can be OPEN, CLOSED | |
// Device Heating can be ON, OFF | |
// | |
// Rule 'Close the window when heating is turned on' |
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" | |
} | |
}); |
NewerOlder