-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #358 from DimitriPlotnikov/grammar_simplification
Grammar simplification: define all languages in the same grammar.
- Loading branch information
Showing
247 changed files
with
2,290 additions
and
3,549 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright (c) 2015 RWTH Aachen. All rights reserved. | ||
* | ||
* http://www.se-rwth.de/ | ||
*/ | ||
package org.nest; | ||
|
||
/** | ||
Grammar representing ODE expressions. | ||
*/ | ||
component grammar Literals extends de.monticore.literals.Literals { | ||
|
||
/********************************************************************************************************************* | ||
* Commons-Grammar fragment | ||
*********************************************************************************************************************/ | ||
token SL_COMMENT = | ||
"#" (~('\n' | | ||
'\r' ) | ||
)* : | ||
{ _channel = HIDDEN; | ||
if (getCompiler() != null) { | ||
de.monticore.ast.Comment _comment = new de.monticore.ast.Comment(getText()); | ||
de.se_rwth.commons.SourcePosition startPos = new de.se_rwth.commons.SourcePosition(_tokenStartLine, _tokenStartCharPositionInLine); | ||
_comment.set_SourcePositionStart(startPos); | ||
_comment.set_SourcePositionEnd(getCompiler().computeEndPosition(startPos, getText())); | ||
getCompiler().addComment(_comment); | ||
} | ||
}; | ||
|
||
token NEWLINE = ('\r' '\n' | '\r' | '\n' ); | ||
|
||
token WS = (' ' | '\t'):{_channel = HIDDEN;}; | ||
|
||
// this token enables a statement that is placed in two lines. The first line end with a `\` character | ||
token LINE_ESCAPE = '\\' '\r'? '\n':{_channel = HIDDEN;}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.