PreviousUpNext

15.3.350  src/lib/regex/backend/generalized-regular-expression-engine.api

## generalized-regular-expression-engine.api

# Compiled by:
#     src/lib/std/standard.lib

api Generalized_Regular_Expression_Engine {

    package r:  Abstract_Regular_Expression;

    # The type of a compiled regular expression:
    #
    Compiled_Regular_Expression;

    # Compile a regular expression
    # from the abstract syntax:
    #
    compile:  r::Abstract_Regular_Expression -> Compiled_Regular_Expression;

    # Scan a stream for the first occurrence
    # of a regular expression:
    #
    find:  Compiled_Regular_Expression
           ->
           number_string::Reader( Char, X )
           ->
           number_string::Reader(
               regex_match_result::Regex_Match_Result( Null_Or { match_position:  X, match_length:  Int } ),
               X
           );

    # Attempt to match the stream
    # at the current position
    # with the regular expression:
    #
    prefix:  Compiled_Regular_Expression
             ->
             number_string::Reader( Char, X )
             ->
             number_string::Reader (regex_match_result::Regex_Match_Result( Null_Or { match_position:  X, match_length:  Int } ), X );



    # Attempt to the match the stream at the current position with one of
    # the abstract syntax representations of regular expressions and trigger
    # the corresponding action:
    #
    match:   List ( ( r::Abstract_Regular_Expression,
                      regex_match_result::Regex_Match_Result( Null_Or { match_position: X, match_length: Int } ) -> Y
                  ) )
             -> 
             number_string::Reader (Char, X)
             ->
             number_string::Reader (Y, X);


};



## COPYRIGHT (c) 1998 Bell Labs, Lucent Technologies.
## Subsequent changes by Jeff Prothero Copyright (c) 2010-2015,
## released per terms of SMLNJ-COPYRIGHT.


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext