Skip to content

Commit

Permalink
[lang] Enable XExpression for the formal parameter default values.
Browse files Browse the repository at this point in the history
close #592

Signed-off-by: Stéphane Galland <galland@arakhne.org>
  • Loading branch information
gallandarakhneorg committed Mar 22, 2017
1 parent 9b8438e commit 06941dd
Show file tree
Hide file tree
Showing 17 changed files with 1,425 additions and 1,227 deletions.
Expand Up @@ -44511,9 +44511,9 @@ rule__Parameter__DefaultValueAssignment_6_1_1
}
:
(
{ before(grammarAccess.getParameterAccess().getDefaultValueXLiteralParserRuleCall_6_1_1_0()); }
ruleXLiteral
{ after(grammarAccess.getParameterAccess().getDefaultValueXLiteralParserRuleCall_6_1_1_0()); }
{ before(grammarAccess.getParameterAccess().getDefaultValueXExpressionParserRuleCall_6_1_1_0()); }
ruleXExpression
{ after(grammarAccess.getParameterAccess().getDefaultValueXExpressionParserRuleCall_6_1_1_0()); }
)
;
finally {
Expand Down

Large diffs are not rendered by default.

Binary file not shown.
Expand Up @@ -997,7 +997,7 @@ ruleParameter:
'*'
|
'='
ruleXLiteral
ruleXExpression
)?
;

Expand Down
Expand Up @@ -7379,9 +7379,9 @@ ruleParameter returns [EObject current=null]
(
(
{
newCompositeNode(grammarAccess.getParameterAccess().getDefaultValueXLiteralParserRuleCall_6_1_1_0());
newCompositeNode(grammarAccess.getParameterAccess().getDefaultValueXExpressionParserRuleCall_6_1_1_0());
}
lv_defaultValue_9_0=ruleXLiteral
lv_defaultValue_9_0=ruleXExpression
{
if ($current==null) {
$current = createModelElementForParent(grammarAccess.getParameterRule());
Expand All @@ -7390,7 +7390,7 @@ ruleParameter returns [EObject current=null]
$current,
"defaultValue",
lv_defaultValue_9_0,
"org.eclipse.xtext.xbase.Xbase.XLiteral");
"org.eclipse.xtext.xbase.Xbase.XExpression");
afterParserOrEnumRuleCall();
}
)
Expand Down

Large diffs are not rendered by default.

Expand Up @@ -1411,7 +1411,7 @@ protected void sequence_Member(ISerializationContext context, SarlInterface sema
* (extension?='extension' annotations+=XAnnotation*)?
* name=ValidID
* parameterType=JvmTypeReference
* (varArg?='*' | defaultValue=XLiteral)?
* (varArg?='*' | defaultValue=XExpression)?
* )
*/
protected void sequence_Parameter(ISerializationContext context, SarlFormalParameter semanticObject) {
Expand Down
Expand Up @@ -4597,15 +4597,15 @@ public class ParameterElements extends AbstractParserRuleElementFinder {
private final Group cGroup_6_1 = (Group)cAlternatives_6.eContents().get(1);
private final Keyword cEqualsSignKeyword_6_1_0 = (Keyword)cGroup_6_1.eContents().get(0);
private final Assignment cDefaultValueAssignment_6_1_1 = (Assignment)cGroup_6_1.eContents().get(1);
private final RuleCall cDefaultValueXLiteralParserRuleCall_6_1_1_0 = (RuleCall)cDefaultValueAssignment_6_1_1.eContents().get(0);
private final RuleCall cDefaultValueXExpressionParserRuleCall_6_1_1_0 = (RuleCall)cDefaultValueAssignment_6_1_1.eContents().get(0);

//Parameter xtend::XtendParameter:
// {SarlFormalParameter} annotations+=XAnnotation* (extension?='extension' annotations+=XAnnotation*)?
// name=ValidID ':' parameterType=JvmTypeReference (varArg?='*' | '=' defaultValue=XLiteral)?;
// name=ValidID ':' parameterType=JvmTypeReference (varArg?='*' | '=' defaultValue=XExpression)?;
@Override public ParserRule getRule() { return rule; }

//{SarlFormalParameter} annotations+=XAnnotation* (extension?='extension' annotations+=XAnnotation*)? name=ValidID ':'
//parameterType=JvmTypeReference (varArg?='*' | '=' defaultValue=XLiteral)?
//parameterType=JvmTypeReference (varArg?='*' | '=' defaultValue=XExpression)?
public Group getGroup() { return cGroup; }

//{SarlFormalParameter}
Expand Down Expand Up @@ -4647,7 +4647,7 @@ public class ParameterElements extends AbstractParserRuleElementFinder {
//JvmTypeReference
public RuleCall getParameterTypeJvmTypeReferenceParserRuleCall_5_0() { return cParameterTypeJvmTypeReferenceParserRuleCall_5_0; }

//(varArg?='*' | '=' defaultValue=XLiteral)?
//(varArg?='*' | '=' defaultValue=XExpression)?
public Alternatives getAlternatives_6() { return cAlternatives_6; }

//varArg?='*'
Expand All @@ -4656,17 +4656,17 @@ public class ParameterElements extends AbstractParserRuleElementFinder {
//'*'
public Keyword getVarArgAsteriskKeyword_6_0_0() { return cVarArgAsteriskKeyword_6_0_0; }

//'=' defaultValue=XLiteral
//'=' defaultValue=XExpression
public Group getGroup_6_1() { return cGroup_6_1; }

//'='
public Keyword getEqualsSignKeyword_6_1_0() { return cEqualsSignKeyword_6_1_0; }

//defaultValue=XLiteral
//defaultValue=XExpression
public Assignment getDefaultValueAssignment_6_1_1() { return cDefaultValueAssignment_6_1_1; }

//XLiteral
public RuleCall getDefaultValueXLiteralParserRuleCall_6_1_1_0() { return cDefaultValueXLiteralParserRuleCall_6_1_1_0; }
//XExpression
public RuleCall getDefaultValueXExpressionParserRuleCall_6_1_1_0() { return cDefaultValueXExpressionParserRuleCall_6_1_1_0; }
}
public class XtendEnumLiteralElements extends AbstractParserRuleElementFinder {
private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "io.sarl.lang.SARL.XtendEnumLiteral");
Expand Down Expand Up @@ -5591,7 +5591,7 @@ public ParserRule getAnnotationFieldRule() {

//Parameter xtend::XtendParameter:
// {SarlFormalParameter} annotations+=XAnnotation* (extension?='extension' annotations+=XAnnotation*)?
// name=ValidID ':' parameterType=JvmTypeReference (varArg?='*' | '=' defaultValue=XLiteral)?;
// name=ValidID ':' parameterType=JvmTypeReference (varArg?='*' | '=' defaultValue=XExpression)?;
public ParameterElements getParameterAccess() {
return pParameter;
}
Expand Down
Expand Up @@ -413,7 +413,7 @@ Parameter returns xtend::XtendParameter:
(extension?='extension' annotations+=XAnnotation*)?
name=ValidID ':' parameterType=JvmTypeReference
( (varArg?='*')
| ('=' defaultValue=XLiteral))?
| ('=' defaultValue=XExpression))?
;

XtendEnumLiteral returns xtend::XtendEnumLiteral:
Expand Down
2 changes: 1 addition & 1 deletion formatting-styles/gtk/sarl.lang
Expand Up @@ -24,7 +24,7 @@
limitations under the License.
-->
<!-- Style for SARL 0.5 -->
<!-- Style for SARL 0.6 -->
<language id="sarl" _name="SARL" version="2.0" _section="Sources">
<metadata>
<property name="mimetypes">text/x-sarl</property>
Expand Down
4 changes: 2 additions & 2 deletions formatting-styles/latex/sarl-beamer-listing.sty
Expand Up @@ -22,7 +22,7 @@
% limitations under the License.
%
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesPackage{sarl-beamer-listing}[2017/03/18]
\ProvidesPackage{sarl-beamer-listing}[2017/03/22]
\RequirePackage{algpseudocode}
\RequirePackage{listings}
\RequirePackage{xspace}
Expand Down Expand Up @@ -69,5 +69,5 @@
}
\newcommand{\code}[1]{\ifmmode\text{\lstinline[basicstyle=\usebeamertemplate{code inline style}]{#1}}\else\lstinline[basicstyle=\usebeamertemplate{code inline style}]{#1}\fi}
\newcommand{\sarl}{\mbox{SARL}\xspace}
\newcommand{\sarlversion}{0.5}
\newcommand{\sarlversion}{0.6}
\endinput
4 changes: 2 additions & 2 deletions formatting-styles/latex/sarl-colorized-listing.sty
Expand Up @@ -22,7 +22,7 @@
% limitations under the License.
%
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesPackage{sarl-colorized-listing}[2017/03/18]
\ProvidesPackage{sarl-colorized-listing}[2017/03/22]
\RequirePackage{algpseudocode}
\RequirePackage{listings}
\RequirePackage{xspace}
Expand Down Expand Up @@ -74,5 +74,5 @@
}
\newcommand{\code}[1]{\ifmmode\text{\lstinline[basicstyle=\normalcolor]{#1}}\else\lstinline[basicstyle=\normalcolor]{#1}\fi}
\newcommand{\sarl}{\mbox{SARL}\xspace}
\newcommand{\sarlversion}{0.5}
\newcommand{\sarlversion}{0.6}
\endinput
4 changes: 2 additions & 2 deletions formatting-styles/latex/sarl-listing.sty
Expand Up @@ -22,7 +22,7 @@
% limitations under the License.
%
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesPackage{sarl-listing}[2017/03/18]
\ProvidesPackage{sarl-listing}[2017/03/22]
\RequirePackage{algpseudocode}
\RequirePackage{listings}
\RequirePackage{xspace}
Expand Down Expand Up @@ -61,5 +61,5 @@
}
\newcommand{\code}[1]{\ifmmode\text{\lstinline[basicstyle=\normalcolor]{#1}}\else\lstinline[basicstyle=\normalcolor]{#1}\fi}
\newcommand{\sarl}{\mbox{SARL}\xspace}
\newcommand{\sarlversion}{0.5}
\newcommand{\sarlversion}{0.6}
\endinput
2 changes: 1 addition & 1 deletion formatting-styles/prettify/lang-sarl.js
Expand Up @@ -21,7 +21,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* Style for SARL 0.5 */
/* Style for SARL 0.6 */
PR['registerLangHandler'](
PR['createSimpleLexer'](
[
Expand Down
2 changes: 1 addition & 1 deletion formatting-styles/source-highlight/sarl.lang
Expand Up @@ -21,7 +21,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Style for SARL 0.5
# Style for SARL 0.6

preproc = "import","package"

Expand Down
Expand Up @@ -21,7 +21,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* Style for SARL 0.5 */
/* Style for SARL 0.6 */
PR['registerLangHandler'](
PR['createSimpleLexer'](
[
Expand Down

0 comments on commit 06941dd

Please sign in to comment.