public class PatternApplication extends Object
| Modifier and Type | Field and Description |
|---|---|
Vector |
bestActions
the sequence of actions associated with the best pattern match found
so far.
|
HashMap |
bestBindings
the bindings of variables to values associated with the best pattern
match found so far.
|
String |
bestPatternName
the name of the best pattern match found so far.
|
int |
bestPosition
if a match has been found, the document position matching the end of
the pattern.
|
boolean |
matchFound
true if a match has been found between the pattern graph and
the Document.
|
static boolean |
patternApplyTrace
if true, write a trace message to the console whenever a
the actions associated with a pattern are applied.
|
static boolean |
patternMatchTrace
if true, write a trace message to the console whenever a
pattern is successfully matched.
|
int |
startPosition
the position in the Document where the matching starts.
|
| Constructor and Description |
|---|
PatternApplication(Document doc,
int start) |
| Modifier and Type | Method and Description |
|---|---|
static JMenu |
applySubmenu()
Returns the "Pattern Apply Trace" submenu used in the Console's
"Patterns" menu.
|
static JMenu |
matchSubmenu()
Returns the "Pattern Match Trace" submenu used in the Console's
"Patterns" menu.
|
static JMenu |
patternMenu()
Returns a menu for controlling the pattern matcher (part of the Console menu
bar).
|
int |
performActions()
perform the actions associated with this pattern application.
|
void |
recordMatch(int position,
String patternName,
HashMap bindings,
Vector actions)
invoked for a successful match of a pattern.
|
public boolean matchFound
public int startPosition
public int bestPosition
public String bestPatternName
public HashMap bestBindings
public Vector bestActions
public static boolean patternMatchTrace
public static boolean patternApplyTrace
public PatternApplication(Document doc, int start)
public void recordMatch(int position,
String patternName,
HashMap bindings,
Vector actions)
position - position in document reached by end of patternbindings - variable bindings for this patternactions - actions to be performed if this is best pattern matchpublic int performActions()
public static JMenu patternMenu()
public static JMenu matchSubmenu()
public static JMenu applySubmenu()
Copyright © 2016 New York University. All rights reserved.