Changeset 2239 for proto


Ignore:
Timestamp:
Jul 9, 2012, 7:57:24 PM (7 years ago)
Author:
ksherdy
Message:

Moved input files.

Location:
proto/scatterRE/input
Files:
1 added
1 deleted
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • proto/scatterRE/input/re.scatter

    r2237 r2239  
    1 // a token definition is given by the form
    2 //              tokenDefinition → terminal (string* | className)
     1// A token definition is given by the form
     2// tokenDefinition → terminal (string* | className)
    33// and it is terminated (not separated) with a comma.
    44//
    55// If there are no strings or identifier following the token-name,
    66// the token-name is assigned an implicit lexeme formed by converting
    7 // the token-name to lowercase.  For example,
    8 //              TOKENS,
    9 // is the same as
    10 //              TOKENS "tokens",
     7// the token-name to lowercase.  For example, TOKENS,
     8// is the same as TOKENS "tokens",
    119//
    1210// the token definition strings may be a bunch of alphabetic characters
     
    1513
    1614tokens {
     15        IDENTIFIER IdentifierToken,
    1716
    18 //      STRING StringConstantToken,
    19         IDENTIFIER IdentifierToken,
    20         NUMBER IntConstantToken, // {int value;},
     17        LEFTROUND "(",
     18        RIGHTROUND ")",
     19
     20        OR "|",
     21
     22        OPTIONAL "?",
     23        STAR "*",
     24        PLUS "+",
    2125       
    2226        COMMENT_START "//",
     27
    2328}
    2429
    25 interfaces {
    26 //      compressible {boolean compress = false; },
    27 //      raisable {boolean raise = false; },
    28 //      omittable {boolean omit = false; },
    29 //      childIndexed {int childIndex = 0; boolean tokenReference = false; boolean integerConstant = false;},
    30 //      intValued {int value = 0;},
    31 }
    32 
    33 // Use ASTNode for nodes that are created but later omitted.
    34 nodes {
    35 //      identifier {compressible; raisable; omittable;} [],
    36 //      symbolReference {childIndexed;} [],
    37 //      number {intValued;} [signedNumber],
    38 //      binaryOperation [attributeExpression],
    39 //      lextant [leftAssoc],
    40 }
     30interfaces {}
     31nodes {}
    4132
    4233grammar {
    43         start -> a a b* ;
    44         a -> IDENTIFIER ;
    45         b -> NUMBER ;
     34        start → re ;
     35        re ʉ → alternation ;
     36        alternation ʉ → concatenation (OR concatenation)* ; 
     37        concatenation ʉ → repetition+ ;                                             
     38        repetition ʉ → atom repetitionIndicator^? ;
     39        atom ʉ → LEFTROUND re RIGHTROUND | identifier ;
     40        identifier → IDENTIFIER;
     41        repetitionIndicator → OPTIONAL | STAR | PLUS ;
    4642}
  • proto/scatterRE/input/tests/test1.re

    r2237 r2239  
    1 a a b
     1( a * | b * ) *
Note: See TracChangeset for help on using the changeset viewer.