Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SDF -> BGF extractor is made much more advanced
git-svn-id: https://slps.svn.sourceforge.net/svnroot/slps@950 ab42f6e0-554d-0410-b580-99e487e6eeb2
- Loading branch information
1 parent
eea62bd
commit abc637a
Showing
9 changed files
with
137 additions
and
50 deletions.
There are no files selected for viewing
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 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 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
File renamed without changes.
File renamed without changes.
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 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,56 @@ | ||
module Tokens | ||
|
||
imports | ||
languages/sdf2/syntax/Literals | ||
languages/sdf2/syntax/Sorts | ||
languages/xml/syntax/XML | ||
basic/StrCon | ||
basic/IdentifierCon | ||
|
||
exports | ||
sorts | ||
CharData | ||
context-free syntax | ||
sort2chardata(Sort) -> CharData | ||
strcon2chardata(StrCon) -> Content | ||
sqstrcon2chardata(SingleQuotedStrCon) -> Content | ||
idcon2chardata(IdCon) -> CharData | ||
strchar2strcon(StrChar) -> Content | ||
|
||
hiddens | ||
lexical syntax | ||
%% Let's remind ourselves of the relevant lexical syntax. | ||
%% | ||
%% 1. languages/sdf2/syntax/Sorts | ||
%% head:[A-Z] -> Sort {cons("one-char")} | ||
%% head:[A-Z] middle:[A-Za-z0-9\-]* last:[A-Za-z0-9] -> Sort {cons("more-chars")} | ||
%% | ||
%% 2. languages/xml/syntax/XML | ||
%% ~[\<\&]+ -> CharData {avoid} | ||
%% ~[\<\&]* "]]>" ~[\<\&]* -> CharData {reject} | ||
%% | ||
%% 3. basic/StrCon | ||
%% "\\n" -> StrChar {cons("newline")} | ||
%% "\\t" -> StrChar {cons("tab")} | ||
%% "\\\"" -> StrChar {cons("quote")} | ||
%% "\\\\" -> StrChar {cons("backslash")} | ||
%% "\\" a:[0-9]b:[0-9]c:[0-9] -> StrChar {cons("decimal")} | ||
%% ~[\0-\31\n\t\"\\] -> StrChar {cons("normal")} | ||
%% [\"] chars:StrChar* [\"] -> StrCon {cons("default")} | ||
|
||
lexical variables | ||
"&Head" [0-9]* -> [A-Z] %% Part of Sort | ||
"&IdHead" [0-9]* -> [A-Za-z] %% Part of IdCon | ||
"&Middle" [0-9]* -> [A-Za-z0-9\-] %% Part of Sort | ||
"&Middles" [0-9]* -> [A-Za-z0-9\-]* %% Part of Sort | ||
"&Last" [0-9]* -> [A-Za-z0-9] %% Part of Sort | ||
"&Char" [0-9]* -> ~[\<\&] %% Part of CharData | ||
"&Chars" [0-9]* -> ~[\<\&]* %% Part of CharData | ||
"&StrChar" [0-9]* -> StrChar %% Part of StrCon | ||
"&StrChar+" [0-9]* -> StrChar+ %% Part of StrCon | ||
"&Chr" [0-9]* -> ~[\0-\31\n\t\"\\\<\&] | ||
"&Ch" [0-9]* -> ~[\0-\31\n\t\'\\\<\&] | ||
"&Both" -> ~[\0-\31\n\t\"\\\<\&] /\ ~[\<\&] | ||
"&StrCon" [0-9]* -> StrCon | ||
"&SQStrChar" [0-9]* -> SingleQuotedStrChar %% Part of SingleQuotedStrCon | ||
"&SQStrChar+" [0-9]* -> SingleQuotedStrChar+ %% Part of SingleQuotedStrCon |
File renamed without changes.
This file was deleted.
Oops, something went wrong.