Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/338.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 嵌套缩进语言的Xtext语法_Java_Eclipse_Eclipse Plugin_Antlr_Xtext - Fatal编程技术网

Java 嵌套缩进语言的Xtext语法

Java 嵌套缩进语言的Xtext语法,java,eclipse,eclipse-plugin,antlr,xtext,Java,Eclipse,Eclipse Plugin,Antlr,Xtext,我正试图为一种语言编写Xtext语法,如下所示: on Producer1 then ProducerConsumer1 then ProducerConsumer1_1 then ProducerConsumer1_2 then ProducerConsumer1_2_1 then ProducerConsumer2 then ProducerConsumer2_1 on Producer2 th

我正试图为一种语言编写Xtext语法,如下所示:

on Producer1
    then ProducerConsumer1
        then ProducerConsumer1_1
        then ProducerConsumer1_2
            then ProducerConsumer1_2_1
    then ProducerConsumer2
        then ProducerConsumer2_1

on Producer2
    then ProducerConsumer1
通过以下语法,我可以在Eclipse编辑器中看到,空格块已被确认,但没有按照我的预期嵌套:

Model:
    model+=On+
;

On:
    'on' producer=ValidID
    BEGIN
        (producerConsumers+=Then)*
    END
;

Then:
    'then' producerConsumer=ValidID
    BEGIN
        (children+=Then)*
    END
;

terminal BEGIN: 'synthetic:BEGIN';  // increase indentation
terminal END: 'synthetic:END';      // decrease indentation
我是Xtext新手,希望能有人指点我的错误所在。

你的意思是

Then:
'then' producerConsumer=ID
(BEGIN
    (children+=Then)+
END)?