fuzzydl.parser
Class Parser

java.lang.Object
  extended by fuzzydl.parser.Parser
All Implemented Interfaces:
ParserConstants

public class Parser
extends java.lang.Object
implements ParserConstants

Parses an input file containing a fuzzy ontology.


Field Summary
 Token jj_nt
          Next token.
 Token token
          Current token.
 ParserTokenManager token_source
          Generated Token Manager.
 
Fields inherited from interface fuzzydl.parser.ParserConstants
ALL, AND, BNP_QUERY, BOTTOM, BV, CLASSICAL, COM, COMMA, COMMENT_MARK, CONSTRAINTS, CP, CRISP, CSB, DEFAULT, DEFINE_CONCEPT, DEFINE_FUZZY_CONCEPT, DEFINE_FUZZY_EQUIVALENCE, DEFINE_FUZZY_NUMBER, DEFINE_FUZZY_NUMBER_RANGE, DEFINE_FUZZY_SIMILARITY, DEFINE_MODIFIER, DEFINE_PRIMITIVE_CONCEPT, DEFINE_TRUTH_CONSTANT, DISJOINT, DISJOINT_UNION, DOMAIN, EOF, EOL, EQL, FR, FUNCTIONAL, FUZZY_LOGIC, FUZZY_NUMBER_ADD, FUZZY_NUMBER_DIV, FUZZY_NUMBER_MINUS, FUZZY_NUMBER_MULT, G_AND, G_IMPLIES, G_OR, GRE, IDENTIFIER, IMPLIES, IMPLIES_ROLE, INSTANCE, INVERSE, KD_IMPLIES, L_AND, L_IMPLIES, L_OR, LESS, LM, LOM_DEFUZZIFY_QUERY, LOOSE_LOWER_APPROX, LOOSE_UPPER_APPROX, LOWER_APPROX, LS, LUKASIEWICZ, MAX_G_SUBSUMES_QUERY, MAX_INSTANCE_QUERY, MAX_KD_SUBSUMES_QUERY, MAX_L_SUBSUMES_QUERY, MAX_QUERY, MAX_RELATED_QUERY, MAX_SATISFIABLE_QUERY, MAX_SUBSUMES_QUERY, MIN_G_SUBSUMES_QUERY, MIN_INSTANCE_QUERY, MIN_KD_SUBSUMES_QUERY, MIN_L_SUBSUMES_QUERY, MIN_QUERY, MIN_RELATED_QUERY, MIN_SATISFIABLE_QUERY, MIN_SUBSUMES_QUERY, MINUS, MOM_DEFUZZIFY_QUERY, NOT, NUMBER, NUMBER_TYPE, OP, OR, OSB, PLUS, RANGE, REFLEXIVE, RELATED, RS, SELF, SHOW_ABSTRACT_FILLER, SHOW_ABSTRACT_FILLER_FOR, SHOW_CONCEPTS, SHOW_CONCRETE_FILLER, SHOW_CONCRETE_FILLER_AND_LABELS, SHOW_CONCRETE_FILLER_FOR, SHOW_INSTANCES, SHOW_LANGUAGE, SHOW_VARIABLES, SINGLE_LINE_COMMENT, SOM_DEFUZZIFY_QUERY, SOME, STAR, STRING_TYPE, SYMMETRIC, TIGHT_LOWER_APPROX, TIGHT_UPPER_APPROX, tokenImage, TOP, TRANSITIVE, TRAP, TRI, TRIAM, UPPER_APPROX, W_SUM, Z_IMPLIES, ZADEH
 
Constructor Summary
Parser(java.io.InputStream stream)
          Constructor with InputStream.
Parser(java.io.InputStream stream, java.lang.String encoding)
          Constructor with InputStream and supplied encoding
Parser(ParserTokenManager tm)
          Constructor with generated Token Manager.
Parser(java.io.Reader stream)
          Constructor.
 
Method Summary
 void checkAbstract(Concept c)
          Checks whether a concept is abstract.
 void clearKB()
          Clear the fuzzy KB.
 void disable_tracing()
          Disable tracing.
 void enable_tracing()
          Enable tracing.
 ParseException generateParseException()
          Generate ParseException.
 KnowledgeBase getKB()
          Gets the fuzzy KB.
static KnowledgeBase getKB(java.lang.String fileName)
          Creates a fuzzy KB from an external file.
 Token getNextToken()
          Get the next Token.
 java.util.ArrayList<Query> getQueries()
          Gets the queries.
 java.lang.String getString()
          Gets a String from a Token.
 Token getToken(int index)
          Get the specific Token.
static void main(java.lang.String[] args)
           
 java.lang.String NumericalType()
          Gets a fuzzyDL representation of the numerical types for the range of concrete features
 void ReInit(java.io.InputStream stream)
          Reinitialise.
 void ReInit(java.io.InputStream stream, java.lang.String encoding)
          Reinitialise.
 void ReInit(ParserTokenManager tm)
          Reinitialise.
 void ReInit(java.io.Reader stream)
          Reinitialise.
 void Start()
           
 java.lang.String StringType()
          Gets a fuzzyDL representation of the type "string" for the range of concrete features
 WeightedConcept WeightedConcept()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

token_source

public ParserTokenManager token_source
Generated Token Manager.


token

public Token token
Current token.


jj_nt

public Token jj_nt
Next token.

Constructor Detail

Parser

public Parser(java.io.InputStream stream)
Constructor with InputStream.


Parser

public Parser(java.io.InputStream stream,
              java.lang.String encoding)
Constructor with InputStream and supplied encoding


Parser

public Parser(java.io.Reader stream)
Constructor.


Parser

public Parser(ParserTokenManager tm)
Constructor with generated Token Manager.

Method Detail

main

public static void main(java.lang.String[] args)
                 throws FuzzyOntologyException,
                        java.io.IOException,
                        ParseException,
                        TokenMgrError
Throws:
FuzzyOntologyException
java.io.IOException
ParseException
TokenMgrError

getKB

public KnowledgeBase getKB()
Gets the fuzzy KB.


clearKB

public void clearKB()
Clear the fuzzy KB.


getQueries

public java.util.ArrayList<Query> getQueries()
Gets the queries.


getKB

public static KnowledgeBase getKB(java.lang.String fileName)
Creates a fuzzy KB from an external file.


Start

public final void Start()
                 throws ParseException,
                        FuzzyOntologyException
Throws:
ParseException
FuzzyOntologyException

WeightedConcept

public final WeightedConcept WeightedConcept()
                                      throws ParseException,
                                             FuzzyOntologyException
Throws:
ParseException
FuzzyOntologyException

checkAbstract

public final void checkAbstract(Concept c)
                         throws ParseException,
                                FuzzyOntologyException
Checks whether a concept is abstract.

Throws:
ParseException
FuzzyOntologyException

getString

public final java.lang.String getString()
                                 throws ParseException
Gets a String from a Token.

Throws:
ParseException

StringType

public final java.lang.String StringType()
                                  throws ParseException
Gets a fuzzyDL representation of the type "string" for the range of concrete features

Throws:
ParseException

NumericalType

public final java.lang.String NumericalType()
                                     throws ParseException
Gets a fuzzyDL representation of the numerical types for the range of concrete features

Throws:
ParseException

ReInit

public void ReInit(java.io.InputStream stream)
Reinitialise.


ReInit

public void ReInit(java.io.InputStream stream,
                   java.lang.String encoding)
Reinitialise.


ReInit

public void ReInit(java.io.Reader stream)
Reinitialise.


ReInit

public void ReInit(ParserTokenManager tm)
Reinitialise.


getNextToken

public final Token getNextToken()
Get the next Token.


getToken

public final Token getToken(int index)
Get the specific Token.


generateParseException

public ParseException generateParseException()
Generate ParseException.


enable_tracing

public final void enable_tracing()
Enable tracing.


disable_tracing

public final void disable_tracing()
Disable tracing.