fuzzydl.parser

## Class Parser

- java.lang.Object
- - fuzzydl.parser.Parser

- All Implemented Interfaces:
    fuzzydl.parser.ParserConstants

      public class Parser
      extends java.lang.Object
      implements fuzzydl.parser.ParserConstants

  Parses an input file containing a fuzzy ontology.
  Author:
    Fernando Bobillo

- - ### Field Summary

    - ### Fields inherited from interface fuzzydl.parser.ParserConstants

      `ALL, ALL_INSTANCE_QUERY, AND, BNP_QUERY, BOOLEAN_TYPE, BOTTOM, BV, CCB, CHOQUET, CLASSICAL, CLASSIFY, COM, COMMA, COMMENT_MARK, CONSTRAINTS, CP, CRISP, CRISP_CONCEPT, CRISP_ROLE, 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, EQUIVALENT_CONCEPTS, FR, FUNCTIONAL, FUZZY_LOGIC, FUZZY_NUMBER_ADD, FUZZY_NUMBER_DIV, FUZZY_NUMBER_MINUS, FUZZY_NUMBER_MULT, G_AND, G_IMPLIES, G_OR, GRE, HAS_VALUE, IDENTIFIER, IMPLIES, IMPLIES_ROLE, INSTANCE, INVERSE, INVERSE_FUNCTIONAL, KD_IMPLIES, L_AND, L_IMPLIES, L_OR, LESS, LINEAR, 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, MODIFIED, MOM_DEFUZZIFY_QUERY, NOT, NUMBER, NUMBER_TYPE, OCB, OP, OR, OSB, OWA, PLUS, QOWA, QSUGENO, RANGE, REFLEXIVE, RELATED, RS, SATISFIABLE_QUERY, 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, SUGENO, SYMMETRIC, TIGHT_LOWER_APPROX, TIGHT_UPPER_APPROX, tokenImage, TOP, TRANSITIVE, TRAP, TRI, TRIAM, UPPER_APPROX, W_MAX, W_MIN, W_SUM, W_SUM_ZERO, Z_IMPLIES, ZADEH`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Parser(java.io.InputStream stream)` Constructor with InputStream.
    `Parser(java.io.Reader stream)` Constructor.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clearKB()` Clears a KB.
    `KnowledgeBase` | `getKB()` Gets a KB.
    `static KnowledgeBase` | `getKB(java.lang.String fileName)` Creates a fuzzy KB from an external file.
    `java.util.ArrayList<Query>` | `getQueries()` Gets the queries in the file.
    `static void` | `main(java.lang.String[] args)` Main program.
    `static void` | `reset()` Reset the parser.
    `void` | `Start()`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Parser

          public Parser(java.io.InputStream stream)

      Constructor with InputStream.
      Parameters:
        `stream` - Stream.

    - #### Parser

          public Parser(java.io.Reader stream)

      Constructor.
      Parameters:
        `stream` - Stream.

  - ### Method Detail

    - #### reset

          public static void reset()

      Reset the parser.

    - #### main

          public static void main(java.lang.String[] args)
                           throws FuzzyOntologyException,
                                  java.io.IOException,
                                  fuzzydl.parser.TokenMgrError

      Main program.
      Parameters:
        `args` - Name of the input file.
      Throws:
        `FuzzyOntologyException` - The fuzzy ontology is inconsistent.
        `java.io.IOException` - Input-putput error.
        `fuzzydl.parser.TokenMgrError` - Parsing error.

    - #### getKB

          public KnowledgeBase getKB()

      Gets a KB.
      Returns:
        A knowledge base obtained as a result of the parsing.

    - #### clearKB

          public void clearKB()

      Clears a KB.

    - #### getQueries

          public java.util.ArrayList<Query> getQueries()

      Gets the queries in the file.
      Returns:
        A list of queries obtained as a result of the parsing.

    - #### getKB

          public static KnowledgeBase getKB(java.lang.String fileName)

      Creates a fuzzy KB from an external file.
      Parameters:
        `fileName` - Name of the input file.
      Returns:
        A knowledge base obtained as a result of the parsing.

    - #### Start

          public final void Start()
                           throws fuzzydl.parser.ParseException,
                                  FuzzyOntologyException,
                                  InconsistentOntologyException

      Throws:
        `fuzzydl.parser.ParseException`
        `FuzzyOntologyException`
        `InconsistentOntologyException`