All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class oplan.util.match.SimpleMatcher

java.lang.Object
   |
   +----oplan.util.match.SimpleMatcher

public class SimpleMatcher
extends Object
A simple pattern-matcher.


Variable Index

 o emptyEnv
emptyEnv is used to return non-null without allocating an env.
 o REST

Constructor Index

 o SimpleMatcher()

Method Index

 o match(Object, Object)
Match tries to match a pattern against an object.

Only the pattern can contain variables.

 o match(Object, Object, MatchEnv)
 o matchRest(Object, Object, MatchEnv)
 o success(MatchEnv)
 o when(boolean, MatchEnv)

Variables

 o emptyEnv
 private static final MatchEnv emptyEnv
emptyEnv is used to return non-null without allocating an env.

 o REST
 public static final Symbol REST

Constructors

 o SimpleMatcher
 public SimpleMatcher()

Methods

 o match
 public static MatchEnv match(Object pat,
                              Object dat)
Match tries to match a pattern against an object.

Only the pattern can contain variables. If a variable appears more than once in a pattern, there's no attempt to check that it matches the same thing each time.

For now, numbers are compared as objects, not by comparing their numeric values.

Returns:
a MatchEnv or null.
See Also:
MatchEnv, ItemVar
 o match
 public static MatchEnv match(Object pat,
                              Object dat,
                              MatchEnv env)
 o matchRest
 private static final MatchEnv matchRest(Object pat,
                                         Object dat,
                                         MatchEnv env)
 o when
 private static final MatchEnv when(boolean cond,
                                    MatchEnv env)
 o success
 private static final MatchEnv success(MatchEnv env)

All Packages  Class Hierarchy  This Package  Previous  Next  Index