[SCM] Lisaac compiler branch, stable, updated. lisaac-0.12-467-g03b8358
Mildred Ki'Lya
silkensedai at online.fr
Sat Sep 5 14:24:35 UTC 2009
The following commit has been merged in the stable branch:
commit 03b8358e13d58c5bb9085aa8b6075fd4ee0cb099
Author: Mildred Ki'Lya <silkensedai at online.fr>
Date: Sat Sep 5 16:19:51 2009 +0200
reformat grammar in PARSER
diff --git a/src/parser.li b/src/parser.li
index 0c2e062..91257dc 100644
--- a/src/parser.li
+++ b/src/parser.li
@@ -28,6 +28,8 @@ Section Header
- comment := "Parser for Lisaac language.";
// You can to get current grammar with `grep "//++" parser.li'
+ // `grep "//--" parser.li' can be used to have more details
+ // `grep "////" parser.li' for lip grammar
Section Inherit
@@ -391,7 +393,7 @@ Section Private
result
);
- //-- affect -> ":=" | "<-" | "?="
+ //-- affect -> ":=" | "<-" | "?="
- read_affect:BOOLEAN <-
(
(read_symbol (ALIAS_STR.symbol_affect_immediate)) ||
@@ -399,7 +401,7 @@ Section Private
{read_symbol (ALIAS_STR.symbol_affect_code)}
);
- //-- style -> '-' | '+'
+ //-- style -> '-' | '+'
- read_style:CHARACTER <-
( + result:CHARACTER;
read_character '-'.if {
@@ -414,7 +416,7 @@ Section Private
result
);
- //-- identifier -> 'a'-'z' {'a'-'z' | '0'-'9' | '_'}
+ //-- identifier -> 'a'-'z' {'a'-'z' | '0'-'9' | '_'}
- read_identifier:BOOLEAN <-
( + result:BOOLEAN;
+ posold,idx:INTEGER;
@@ -490,7 +492,7 @@ Section Private
result
);
- //-- keyword -> 'A'-'Z' 'a'-'z' {'a'-'z' | '0'-'9' | '_'}
+ //-- keyword -> 'A'-'Z' 'a'-'z' {'a'-'z' | '0'-'9' | '_'}
- read_keyword:BOOLEAN <-
( + result:BOOLEAN;
// On passe les espaces :
@@ -560,11 +562,11 @@ Section Private
result
);
- //-- integer -> number
- //-- number -> {'0'-'9'} ['d']
- //-- | '0'-'9' {'0'-'9' | 'A'-'F' | 'a'-'f'} 'h'
- //-- | {'0'-'7'} 'o'
- //-- | {'0' | '1'} 'b'
+ //-- integer -> number
+ //-- number -> {'0'-'9'} ['d']
+ //-- | '0'-'9' {'0'-'9' | 'A'-'F' | 'a'-'f'} 'h'
+ //-- | {'0'-'7'} 'o'
+ //-- | {'0' | '1'} 'b'
- read_integer:BOOLEAN <-
( + result:BOOLEAN;
+ pos_old:INTEGER;
@@ -620,7 +622,9 @@ Section Private
);
- read_real:BOOLEAN <-
- //-- real -> '0'-'9' {'0'-'9'_} [ '.' {'0'-'9'} ] [ 'E' ['+'|'-'] '0'-'9' {'0'-'9'}
+ //-- real -> '0'-'9' {'0'-'9'_} [real_decimal] [real_exp]
+ //-- real_decimal -> '.' {'0'-'9'}
+ //-- real_exp -> 'E' ['+'|'-'] '0'-'9' {'0'-'9'}
( + result:BOOLEAN;
+ pos_old:INTEGER;
@@ -679,7 +683,12 @@ Section Private
};
result
);
-
+
+ //-- escape -> '\\' separator {separator} '\\'
+ //-- | '\\' escape_seq
+ //-- | '\\' integer '\\'
+ //-- escape_seq -> 'a' | 'b' | 'f' | 'n' | 'r' | 't'
+ //-- | 'v' | '\\' | '?' | '\'' | '\"' | '0'
- read_escape_character <-
( + nothing:BOOLEAN;
+ val:INTEGER;
@@ -744,7 +753,7 @@ Section Private
};
);
- //-- character -> '\'' ascii '\''
+ //-- character -> '\'' ascii '\''
- read_characters:BOOLEAN <-
( + result:BOOLEAN;
+ old_pos:INTEGER;
@@ -786,7 +795,9 @@ Section Private
result
);
- //-- string -> '\"' ascii_string '\"'
+ //-- string -> '\"' string_char '\"'
+ //-- string_char -> escape
+ //-- | ascii
- read_string:BOOLEAN <-
( + result:BOOLEAN;
+ old_pos:INTEGER;
@@ -821,7 +832,7 @@ Section Private
result
);
- //-- external -> '`' ascii_c_code '`'
+ //-- external -> '`' ascii_c_code '`'
- read_external:BOOLEAN <-
( + result:BOOLEAN;
+ pos_old:INTEGER;
@@ -856,8 +867,8 @@ Section Private
result
);
- //-- operator -> '!' | '@' | '#' | '$' | '%' | '^' | '&' | '<' | '|'
- //-- | '*' | '-' | '+' | '=' | '~' | '/' | '?' | '\' | '>'
+ //-- operator -> '!' | '@' | '#' | '$' | '%' | '^' | '&' | '<' | '|'
+ //-- | '*' | '-' | '+' | '=' | '~' | '/' | '?' | '\' | '>'
- read_operator:BOOLEAN <-
( + result:BOOLEAN;
+ old_pos:INTEGER;
--
Lisaac compiler
More information about the Lisaac-commits
mailing list