Tutorial - Generator's mapping rules
Hi,
I don't seem to have a 'for each' rule for the mapping rules list. When I press ctrl-enter in the field nothing happens. When I press ctrl-space I get a list box with the sole entry 'MappingRule'.
How do I get the 'for each' rule as shown in the tutorial?
Please sign in to leave a comment.
Further to my last post, the following exceptions are being thrown in the command window when I press ctrl-enter in the mapping rules field.
ERROR - jetbrains.mps.smodel.SNode - ERROR: 4 children for role m
appingRule in MappingConfiguration[1141096830816] TheSimplestLanguage.generator.
baseLanguage.template.main@templates
java.lang.Throwable
at jetbrains.mps.logging.Logger.errorWithTrace(Logger.java:65)
at jetbrains.mps.smodel.SNode.getChild(SNode.java:353)
at jetbrains.mps.smodel.SNode.setChild(SNode.java:340)
at jetbrains.mps.smodel.action.DefaultChildNodeSubstituteAction.doSubsti
tute(DefaultChildNodeSubstituteAction.java:68)
at jetbrains.mps.ide.command.CommandUtil.substituteNode(CommandUtil.java
:34)
at jetbrains.mps.nodeEditor.EditorUtil.validateCell(EditorUtil.java:51)
at jetbrains.mps.nodeEditor.EditorComponentKeyboardHandler.processKeyPre
ssed(EditorComponentKeyboardHandler.java:61)
at jetbrains.mps.nodeEditor.AbstractEditorComponent$13.run(AbstractEdito
rComponent.java:1111)
at jetbrains.mps.ide.command.CommandProcessor.executeCommand_internal(Co
mmandProcessor.java:86)
at jetbrains.mps.ide.command.CommandProcessor.executeCommand(CommandProc
essor.java:71)
at jetbrains.mps.ide.command.CommandProcessor.executeCommand(CommandProc
essor.java:56)
at jetbrains.mps.nodeEditor.AbstractEditorComponent.processKeyPressed(Ab
stractEditorComponent.java:1109)
at jetbrains.mps.nodeEditor.AbstractEditorComponent$7.keyPressed(Abstrac
tEditorComponent.java:271)
at java.awt.Component.processKeyEvent(Unknown Source)
at javax.swing.JComponent.processKeyEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Sour
ce)
at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Sour
ce)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Hi David,
can you see anything in the 'mapping rules' section?
according your error trace you should have four rules added.
do you receive any error messages in console when you press 'ctrl-enter' ?
try also 'insert'.
Igor
Hi Igor,
There wasn't anything in the text box, but your suggestion for using the Insert key does work.
Thanks
David