Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Using multiple alternatives 1,2
Using multiple alternatives 1,2 [message #762174] Wed, 07 December 2011 16:44 Go to next message
jerome.linon is currently offline jerome.linonFriend
Messages: 1
Registered: December 2011
Junior Member
Hey Guys,

i have some Problems with my Xtext Grammar. I´m new to this... can u help me?

The Grammar:

Window:
"Window" Windowtitel=STRING
("+color=" color=Colors)?
(elements+=Layout)+
;

Layout:
GridLayout | BoxLayout | TabbedArea
;


BoxLayout:
OneColumnBox | TwoColumnBox | ThreeColumnBox | RadioBox
;


GridLayout:
"GridLayout" rowCount=INT colCount=INT ('{'
(elements+=Cell)+'}')
;

Cell:
GuiElement | Layout
;

TabbedArea:
'TabbedArea' name=ID ('{'
(tabs += Tab)*
'}')?
;

Tab:
'Tab' name=ID text=STRING
(elements+=Layout)+

;

OneColumnBox:
"One-Column-List" (Description=STRING)?
("+color=" color=Colors)?
(elements+=GuiElement)+
;

TwoColumnBox:
"Two-Column-List" (Description=STRING)?
("+color=" color=Colors)?
(elements+=TwoColumnLine)+
;

TwoColumnLine:
firstElement=GuiElement
secondElement=GuiElement
;

ThreeColumnBox:
"Three-Column-List" (Description=STRING)?
("+color=" color=Colors)?
(elements+=ThreeColumnLine)+
;

ThreeColumnLine:
firstElement=GuiElement
secondElement=GuiElement
thirdElement=GuiElement
;

RadioBox:
"RadioBox" (Description=STRING)?
("+color=" color=Colors)?
(radioButtons+=RadioButton)+
;

RadioButton:
CheckedRadioButton | UncheckedRadioButton
;

CheckedRadioButton:
"RadioButton(+)" Text=STRING
("+color=" color=Colors)?
;

UncheckedRadioButton:
"RadioButton( )" Text=STRING
("+color=" color=Colors)?
;

GuiElement:
Button | Label | EditText | CheckBox | DropDown
;

Button:
"Button" Text=STRING
("+color=" color=Colors)?
;


CheckBox:
CheckedCheckBox | UncheckedCheckBox
;

CheckedCheckBox:
"CheckBox [+]" Text=STRING
("+color=" color=Colors)?
;

UncheckedCheckBox:
"CheckBox [ ]" Text=STRING
("+color=" color=Colors)?
;

Label:
"Label" Text=STRING
("+color=" color=Colors)?
(zentriert?="+centered")?
;

EditText:
"EditText" Text=STRING
("+color=" color=Colors)?
;


DropDown:
'DropDown'
name=ID
(topic += Content)*
;

Content:
STRING
;

enum Colors:
null="null" |
blue="blue" |
red="red" |
green="green" |
gray="gray" |
lila="lila" |
orange="orange" |
blueLight="blueLight" |
redLight="redLight" |
greenLight="greenLight" |
grayLight="grayLight" |
lilaLight="lilaLight" |
orangeLight="orangeLight" |
white="white" |
black="black"
;

Errors:

warning(200): ../android/src-gen/android/parser/antlr/internal/InternalAndroidGui.g:566:1: Decision can match input such as "'CheckBox [+]' RULE_STRING" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
warning(200): ../android/src-gen/android/parser/antlr/internal/InternalAndroidGui.g:566:1: Decision can match input such as "'CheckBox [ ]' RULE_STRING" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
warning(200): ../android/src-gen/android/parser/antlr/internal/InternalAndroidGui.g:566:1: Decision can match input such as "'DropDown' RULE_ID" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
warning(200): ../android/src-gen/android/parser/antlr/internal/InternalAndroidGui.g:566:1: Decision can match input such as "'EditText' RULE_STRING" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
warning(200): ../android/src-gen/android/parser/antlr/internal/InternalAndroidGui.g:566:1: Decision can match input such as "'Button' RULE_STRING" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
warning(200): ../android/src-gen/android/parser/antlr/internal/InternalAndroidGui.g:566:1: Decision can match input such as "'Label' RULE_STRING" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
warning(200): ../android/src-gen/android/parser/antlr/internal/InternalAndroidGui.g:627:1: Decision can match input such as "'Button' RULE_STRING 'Label' RULE_STRING" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
warning(200): ../android/src-gen/android/parser/antlr/internal/InternalAndroidGui.g:627:1: Decision can match input such as "'Button' RULE_STRING 'DropDown' RULE_ID" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
warning(200): ../android/src-gen/android/parser/antlr/internal/InternalAndroidGui.g:627:1: Decision can match input such as "'Button' RULE_STRING 'CheckBox [+]' RULE_STRING" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
warning(200): ../android/src-gen/android/parser/antlr/internal/InternalAndroidGui.g:627:1: Decision can match input such as "'Button' RULE_STRING 'CheckBox [ ]' RULE_STRING" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
warning(200): ../android/src-gen/android/parser/antlr/internal/InternalAndroidGui.g:627:1: Decision can match input such as "'Button' RULE_STRING 'EditText' RULE_STRING" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
warning(200): ../android/src-gen/android/parser/antlr/internal/InternalAndroidGui.g:627:1: Decision can match input such as "'Button' RULE_STRING 'Button' RULE_STRING" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
warning(200): ../android/src-gen/android/parser/antlr/internal/InternalAndroidGui.g:745:1: Decision can match input such as "'Button' RULE_STRING 'Button' RULE_STRING 'EditText' RULE_STRING" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
warning(200): ../android/src-gen/android/parser/antlr/internal/InternalAndroidGui.g:745:1: Decision can match input such as "'Button' RULE_STRING 'Button' RULE_STRING 'Button' RULE_STRING" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
warning(200): ../android/src-gen/android/parser/antlr/internal/InternalAndroidGui.g:745:1: Decision can match input such as "'Button' RULE_STRING 'Button' RULE_STRING 'DropDown' RULE_ID" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
warning(200): ../android/src-gen/android/parser/antlr/internal/InternalAndroidGui.g:745:1: Decision can match input such as "'Button' RULE_STRING 'Button' RULE_STRING 'CheckBox [+]' RULE_STRING" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
warning(200): ../android/src-gen/android/parser/antlr/internal/InternalAndroidGui.g:745:1: Decision can match input such as "'Button' RULE_STRING 'Button' RULE_STRING 'CheckBox [ ]' RULE_STRING" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
warning(200): ../android/src-gen/android/parser/antlr/internal/InternalAndroidGui.g:745:1: Decision can match input such as "'Button' RULE_STRING 'Button' RULE_STRING 'Label' RULE_STRING" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
6210 [main] INFO or.validation.JavaValidatorFragment - generating Java-based EValidator API
warning(200): ../android.ui/src-gen/android/ui/contentassist/antlr/internal/InternalAndroidGui.g:1665:42: Decision can match input such as "'EditText' RULE_STRING" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
warning(200): ../android.ui/src-gen/android/ui/contentassist/antlr/internal/InternalAndroidGui.g:1665:42: Decision can match input such as "'CheckBox [ ]' RULE_STRING" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
warning(200): ../android.ui/src-gen/android/ui/contentassist/antlr/internal/InternalAndroidGui.g:1665:42: Decision can match input such as "'CheckBox [+]' RULE_STRING" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
warning(200): ../android.ui/src-gen/android/ui/contentassist/antlr/internal/InternalAndroidGui.g:1665:42: Decision can match input such as "'Label' RULE_STRING" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
warning(200): ../android.ui/src-gen/android/ui/contentassist/antlr/internal/InternalAndroidGui.g:1665:42: Decision can match input such as "'DropDown' RULE_ID" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
warning(200): ../android.ui/src-gen/android/ui/contentassist/antlr/internal/InternalAndroidGui.g:1665:42: Decision can match input such as "'Button' RULE_STRING" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
warning(200): ../android.ui/src-gen/android/ui/contentassist/antlr/internal/InternalAndroidGui.g:1766:42: Decision can match input such as "'Button' RULE_STRING 'CheckBox [ ]' RULE_STRING" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
warning(200): ../android.ui/src-gen/android/ui/contentassist/antlr/internal/InternalAndroidGui.g:1766:42: Decision can match input such as "'Button' RULE_STRING 'EditText' RULE_STRING" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
warning(200): ../android.ui/src-gen/android/ui/contentassist/antlr/internal/InternalAndroidGui.g:1766:42: Decision can match input such as "'Button' RULE_STRING 'DropDown' RULE_ID" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
warning(200): ../android.ui/src-gen/android/ui/contentassist/antlr/internal/InternalAndroidGui.g:1766:42: Decision can match input such as "'Button' RULE_STRING 'Label' RULE_STRING" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
warning(200): ../android.ui/src-gen/android/ui/contentassist/antlr/internal/InternalAndroidGui.g:1766:42: Decision can match input such as "'Button' RULE_STRING 'Button' RULE_STRING" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
warning(200): ../android.ui/src-gen/android/ui/contentassist/antlr/internal/InternalAndroidGui.g:1766:42: Decision can match input such as "'Button' RULE_STRING 'CheckBox [+]' RULE_STRING" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
warning(200): ../android.ui/src-gen/android/ui/contentassist/antlr/internal/InternalAndroidGui.g:1928:44: Decision can match input such as "'Button' RULE_STRING 'Button' RULE_STRING 'Label' RULE_STRING" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
warning(200): ../android.ui/src-gen/android/ui/contentassist/antlr/internal/InternalAndroidGui.g:1928:44: Decision can match input such as "'Button' RULE_STRING 'Button' RULE_STRING 'CheckBox [ ]' RULE_STRING" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
warning(200): ../android.ui/src-gen/android/ui/contentassist/antlr/internal/InternalAndroidGui.g:1928:44: Decision can match input such as "'Button' RULE_STRING 'Button' RULE_STRING 'DropDown' RULE_ID" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
warning(200): ../android.ui/src-gen/android/ui/contentassist/antlr/internal/InternalAndroidGui.g:1928:44: Decision can match input such as "'Button' RULE_STRING 'Button' RULE_STRING 'CheckBox [+]' RULE_STRING" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
warning(200): ../android.ui/src-gen/android/ui/contentassist/antlr/internal/InternalAndroidGui.g:1928:44: Decision can match input such as "'Button' RULE_STRING 'Button' RULE_STRING 'EditText' RULE_STRING" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
warning(200): ../android.ui/src-gen/android/ui/contentassist/antlr/internal/InternalAndroidGui.g:1928:44: Decision can match input such as "'Button' RULE_STRING 'Button' RULE_STRING 'Button' RULE_STRING" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input

[Updated on: Wed, 07 December 2011 16:45]

Report message to a moderator

Re: Using multiple alternatives 1,2 [message #762178 is a reply to message #762174] Wed, 07 December 2011 16:52 Go to previous message
Meinte Boersma is currently offline Meinte BoersmaFriend
Messages: 434
Registered: July 2009
Location: Leiden, Netherlands
Senior Member
Shameless and utterly lazy plug: http://dslmeinte.wordpress.com/2011/12/05/using-syntactic-predicates-in-xtext-part-1/

Previous Topic:Xtend Google Group
Next Topic:refining generated model
Goto Forum:
  


Current Time: Mon Mar 30 01:07:19 GMT 2020

Powered by FUDForum. Page generated in 0.01984 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top