Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[README] updates

Also pushed COOLTHINGS down into new docs/ directory, and added a list of
REGEXES_IN_GGE.
  • Loading branch information...
commit c48c45bbb866eaf56975d5c43ff704803d442a64 1 parent d026724
Carl Mäsak authored February 20, 2010
22  README
@@ -18,18 +18,11 @@ challenge: PGE surprisingly not slow enough? We know a number of ways to
18 18
 fix that...
19 19
 
20 20
 GGE, the Glacial Grammar Engine, is a faithful port of PGE from PIR to Perl
21  
-6. It tries (albeit not too hard) to be implementation-independent, and it
22  
-also attempts (though perhaps not too convincingly) to be a drop-in
23  
-replacement for PGE. Most importantly, besides being written in Perl 6
24  
-rather than PIR, it brings one new essential feature to the table: it's
25  
-slower. Much slower... but still quite cool. Hence the name.
26  
-
27  
-The "albeit not too hard" reservation to the implementation-independence
28  
-stems from the fact that some PIR tricks used by PGE are unavailable in
29  
-Perl 6. When faced with a choice of (a) giving up, and (b) cheating by
30  
-introducing some PIR-dependent workaround, the latter road will be chosen.
31  
-That said, implementation-independence stands as a goal whenever possible,
32  
-just as with all honest Perl 6 code.
  21
+6. It tries to be implementation-independent, and it also attempts (though
  22
+perhaps not too convincingly) to be a drop-in replacement for PGE. Most
  23
+importantly, besides being written in Perl 6 rather than PIR, it brings one new
  24
+essential feature to the table: it's slower. Much slower... but still quite
  25
+cool. Hence the name.
33 26
 
34 27
 The "though perhaps not too convincingly" reservation to GGE attempting to
35 28
 be a drop-in replacement for PGE stems from the fact that now that regular
@@ -40,11 +33,12 @@ course, it would be a fun challenge in itself to restrict the writing of
40 33
 GGE to a strict subset of Perl 6 -- one not using any regexes at all,
41 34
 directly or indirectly -- but that is not the kind of fun optimized for in
42 35
 this case. Future teams of developers are welcome to optimize for that kind
43  
-of fun, should they wish.
  36
+of fun, should they wish. The instances of conscious transgressions in GGE are
  37
+listed in docs/REGEXES_IN_GGE.
44 38
 
45 39
 For an overview of the status of the project, see STATUS. For an overview
46 40
 of the cool things that could be built with the project as a dependency,
47  
-see COOLTHINGS.
  41
+see docs/COOLTHINGS.
48 42
 
49 43
 == License
50 44
 
0  COOLTHINGS → docs/COOLTHINGS
File renamed without changes
44  docs/REGEXES_IN_GGE
... ...
@@ -0,0 +1,44 @@
  1
+Regexes are a very useful construct, even in a regex engine. Since we're not
  2
+in a position where we're building a regex engine for the first time and
  3
+simply *can't* use regex matching, we might as well use it when it's
  4
+convenient.
  5
+
  6
+* The file t/perl6regex/01-regex.t is full of regex matches. We're not
  7
+  testing those regexes anyway, so we might as well use them fully.
  8
+
  9
+* The CodeString.emit method in GGE::Exp uses .subst and regexes to substitute
  10
+  in an argument where it finds '%' followed by a digit or a letter.
  11
+
  12
+* The code emitted for term:<< and term:>> do some /\w/ matching.
  13
+
  14
+* GGE::Match.cclass uses regex matching to check whether a character belongs
  15
+  to a particular character class or not. (Parrot already stores large
  16
+  generated tables with this information. Rather than reproduce those tables
  17
+  in GGE, we call down to PGE.) The methods upper, lower, alpha, digit etc
  18
+  all delegate to the cclass method with different regexes.
  19
+
  20
+* The GGE::Match.ident method does matching agains /<alpha>/ and /\w/.
  21
+
  22
+* The GGE::Match.wb method matches against /\w/.
  23
+
  24
+* The GGE::Match.ws method matches against /\W/ and /\s/.
  25
+
  26
+* GGE::Perl6Regex.parseterm matches against /\s/ and /\w/.
  27
+
  28
+* GGE::Exp::p6escapes matches against /\s/.
  29
+
  30
+* GGE::Exp::parse_term_backslash matches against /\w/.
  31
+
  32
+* GGE::Exp::parse_subname matches against /\w/.
  33
+
  34
+* GGE::Exp::parse_enumcharclass matches against /\s/.
  35
+
  36
+* GGE::Exp::parse_quant matches against /\s/ and /\d/.
  37
+
  38
+* GGE::Exp::parse_dollar matches against /\d/.
  39
+
  40
+* GGE::Exp::parse_modifier matches against /\d/ and /\w+/.
  41
+
  42
+As is clearly evident, those character classes show up everywhere. To really
  43
+rid GGE of all dependencies of an existing grammar engine, one would have to
  44
+give GGE its own generated table with character class information.

0 notes on commit c48c45b

Please sign in to comment.
Something went wrong with that request. Please try again.