SUMMARY: MODULE | CLASS | TYPE | PROC | VAR | CONST | DETAIL: TYPE | PROC | VAR | CONST |
Object Object StringSearch
Class List | |
Builder | Factory for nodes of the abstract syntax tree. |
Expr | Represents a sequence of terms like `a', `[a]', or `a*'. |
Factor | |
Group | Represents list of alternatives, separated by `|'. |
Term | An atomic factor, optionally followed by a quantifier. |
Class Summary: Builder [Detail] | |
+--StringSearch:RegexpParser.Builder Factory for nodes of the abstract syntax tree. | |
Constructor Summary | |
InitBuilder(Builder) | |
NewBuilder(): Builder | |
Method Summary | |
NewExpr(): Expr | |
NewFactor(FactorType): Factor | |
NewGroup(GroupId): Group | |
NewTerm(): Term |
Class Summary: Expr [Detail] | |
+--StringSearch:RegexpParser.Expr Represents a sequence of terms like `a', `[a]', or `a*'. | |
Field Summary | |
next-: Expr Links elements of Group.exprList. | |
termList-: Term Sequence of terms within the expression. | |
Constructor Summary | |
InitExpr(Expr) |
Class Summary: Factor [Detail] | |
+--StringSearch:RegexpParser.Factor | |
Field Summary | |
char-: CHAR For a character match, this field holds the expected character. | |
charSet-: CharSet For a character set match, this field refers to a set of characters. | |
group-: Group For a parenthised group, this field refers to the nested group. | |
type-: FactorType Determines how the factor is matched against input. | |
Constructor Summary | |
InitFactor(Factor, FactorType) |
Class Summary: Group [Detail] | |
+--StringSearch:RegexpParser.Group Represents list of alternatives, separated by `|'. | |
Field Summary | |
exprList-: Expr List of alternatives within this group. | |
groupId-: GroupId Identifier for this group. | |
Constructor Summary | |
InitGroup(Group, GroupId) | |
Parse(Builder, String8, Flags): Group Parses the regular expression in pattern, modified by the options passed in flags. |
Class Summary: Term [Detail] | |
+--StringSearch:RegexpParser.Term An atomic factor, optionally followed by a quantifier. | |
Field Summary | |
factor-: Factor The base expression of the term. | |
next-: Term Links elements of Expr.termList. | |
quantifier-: QuantifierType Specifies how often factor must match for the term to be considered a successful match. | |
Constructor Summary | |
InitTerm(Term) |
Type Summary | |
CharSet = POINTER TO ARRAY n OF SET | |
FactorType = SHORTINT | |
GroupId = SHORTINT | |
QuantifierType = SHORTINT One of exactlyOnce, zeroOrOnceGreedy, zeroOrMoreGreedy, or onceOrMoreGreedy. |
Procedure Summary | |
UpperLower(CHAR, VAR CHAR, VAR CHAR) |
Constant Summary | |
backslash | |
exactlyOnce The expression must match exactly once. | |
matchAfterLastChar | |
matchAnyButNewline | |
matchAtFirstChar | |
matchChar | |
matchCharIgnoreCase | |
matchGroup | |
matchSet | |
matchSetInverted | |
onceOrMoreGreedy The expression must match one or more times. | |
sizeCHAR | |
sizeSET | |
zeroOrMoreGreedy The expression must match zero or more times. | |
zeroOrOnceGreedy The expression can match at most once, and the longest match wins. |
Class Detail: Builder |
Constructor Detail |
PROCEDURE InitBuilder(b: Builder)
PROCEDURE NewBuilder(): Builder
Method Detail |
PROCEDURE (b: Builder) NewExpr(): Expr
PROCEDURE (b: Builder) NewFactor(type: FactorType): Factor
PROCEDURE (b: Builder) NewGroup(groupId: GroupId): Group
PROCEDURE (b: Builder) NewTerm(): Term
Class Detail: Expr |
Field Detail |
FIELD next-: Expr
Links elements of Group.exprList.
FIELD termList-: Term
Sequence of terms within the expression. List is linked by Term.next. Note: This list may be empty, which happens for expressions like `', `()', `(a|)', and so on.
Constructor Detail |
PROCEDURE InitExpr(expr: Expr)
Class Detail: Factor |
Field Detail |
FIELD char-: CHAR
For a character match, this field holds the expected character. Otherwise, it is 0X.
FIELD charSet-: CharSet
For a character set match, this field refers to a set of characters. Otherwise, it is NIL.
FIELD group-: Group
For a parenthised group, this field refers to the nested group. Otherwise, it is NIL.
FIELD type-: FactorType
Determines how the factor is matched against input.
Constructor Detail |
PROCEDURE InitFactor(factor: Factor; type: FactorType)
Class Detail: Group |
Field Detail |
FIELD exprList-: Expr
List of alternatives within this group. List is linked by Expr.next.
FIELD groupId-: GroupId
Identifier for this group. The group that represents the whole regular expression has an id of `0'. The ids of nested groups is derived by counting opening parenthesis before it. The first `(' in the expression gets the id `1', the second `2', and so on.
Constructor Detail |
PROCEDURE InitGroup(group: Group; groupId: GroupId)
PROCEDURE Parse(b: Builder; pattern: String8; flags: Flags): Group
Parses the regular expression in pattern, modified by the options passed in flags.
Result is an abstract syntax tree of the regular expression on success, and NIL on failure. The nodes of the AST a constructed from instances created through the builder object b.
For a short description of regular expression syntax, see StringSearch:RegexpDFA.
Class Detail: Term |
Field Detail |
FIELD factor-: Factor
The base expression of the term.
FIELD next-: Term
Links elements of Expr.termList.
FIELD quantifier-: QuantifierType
Specifies how often factor must match for the term to be considered a successful match.
Constructor Detail |
PROCEDURE InitTerm(term: Term)
Type Detail |
TYPE CharSet = POINTER TO ARRAY n OF SET
TYPE FactorType = SHORTINT
TYPE GroupId = SHORTINT
TYPE QuantifierType = SHORTINT
One of exactlyOnce, zeroOrOnceGreedy, zeroOrMoreGreedy, or onceOrMoreGreedy.
Procedure Detail |
PROCEDURE UpperLower(ch: CHAR; VAR upper: CHAR; VAR lower: CHAR)
Constant Detail |
CONST backslash
CONST exactlyOnce
The expression must match exactly once. Example: `a'.
CONST matchAfterLastChar
CONST matchAnyButNewline
CONST matchAtFirstChar
CONST matchChar
CONST matchCharIgnoreCase
CONST matchGroup
CONST matchSet
CONST matchSetInverted
CONST onceOrMoreGreedy
The expression must match one or more times. The longest match wins. Example: `a+'.
CONST sizeCHAR
CONST sizeSET
CONST zeroOrMoreGreedy
The expression must match zero or more times. The longest match wins. Example: `a*'.
CONST zeroOrOnceGreedy
The expression can match at most once, and the longest match wins. Example: `a?'.