|
Pep 0.4 API Documentation | ||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Objectedu.osu.ling.pep.Category
public class Category
A category in a grammar. Categories are the atomic subparts that make up
grammar rules.
Categories can either be terminal or non-terminal. A
terminal category is one from which no further categories can be derived,
while non-terminal categories can yield a series of other categories when
they occur as the left-hand side of a rule. If a
category is created by specifying only its name, this class's
corresponding constructor assumes that
the category is non-terminal.
Once created, categories are immutable and have no setXxx
methods. This ensures that, once loaded in a grammar, a category will
remain as it was when created.
Rule| Field Summary | |
|---|---|
static Category |
START
Special start category for seeding Earley parsers. |
| Constructor Summary | |
|---|---|
Category(String name)
Creates a new non-terminal category with the specified name. |
|
Category(String name,
boolean terminal)
Creates a new category name with the specified terminal
status. |
|
| Method Summary | |
|---|---|
boolean |
equals(Object obj)
Tests whether this category is equal to another. |
String |
getName()
Gets the name of this category. |
int |
hashCode()
Computes a hash code for this category based on its name and terminal status. |
boolean |
isTerminal()
Gets the terminal status of this category. |
String |
toString()
Gets a string representation of this category. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final Category START
| Constructor Detail |
|---|
public Category(String name)
Category(String, boolean)
public Category(String name,
boolean terminal)
name with the specified terminal
status.
name - The name for this category.terminal - Whether or not this category is a terminal.
IllegalArgumentException - If name is
null or zero-length.| Method Detail |
|---|
public boolean equals(Object obj)
equals in class Objecttrue iff the specified object is an instance
of Category and its name and terminal status are equal
to this category's name and terminal status.public String getName()
public int hashCode()
hashCode in class Objectpublic boolean isTerminal()
public String toString()
toString in class Object
|
Pep: Pep is an Earley parser | ||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the overview file.