how to automatically compile my . java from src-gen?? [message #1051022] |
Sun, 28 April 2013 04:42 |
|
sorry for my english, but I do not quite understand Xbase Interpreter, quickly need at least eclipse directly compile the *. java created in the console to see the result of at least one System.out.printl ("Hello world").
My language definition only have one Statemment, printl
thank you very much
|
|
|
Re: how to automatically compile my . java from src-gen?? [message #1051522 is a reply to message #1051022] |
Sun, 28 April 2013 23:19 |
|
Look my .xtext file...
grammar something with org.eclipse.xtext.xbase.Xbase
generate milenguaje "something"
Inicio:
'paquete' nombre=QualifiedName
(inicio+=Escribir)*
;
Escribir:
'escribir' contenido=STRING ';'
;
truth, is in spanish, and my generator is
override void doGenerate(Resource resource, IFileSystemAccess fsa) {
for(e: resource.allContents.toIterable.filter(typeof(Inicio))){
fsa.generateFile(
e.nombre.toString() +".java",
e.compile
)
}
}
def CharSequence compile(Inicio inicio)'''
import java.io.* ;
public class «inicio.nombre» {
public static void main(String[] args){
«FOR i:inicio.inicio»
«i.compile»
«ENDFOR»
}
}
'''
def compile(Escribir escribir)'''
System.out.println ("«escribir.contenido»") ;
'''
And work fine, but, only need when my user type XBase evaluate this as System.out.println("Hola mundo") and look in console "Hola mundo!!!", in Xtext documentation I no found nothing with Sistem.out ou Sistem.in, and this is very important to any interpreter. Thank very much and I'm sorry for my problem in english language.
|
|
|
Powered by
FUDForum. Page generated in 0.02942 seconds