001: // This file is part of KeY - Integrated Deductive Software Design
002: // Copyright (C) 2001-2007 Universitaet Karlsruhe, Germany
003: // Universitaet Koblenz-Landau, Germany
004: // Chalmers University of Technology, Sweden
005: //
006: // The KeY system is protected by the GNU General Public License.
007: // See LICENSE.TXT for details.
008: //
009: //
010:
011: package de.uka.ilkd.key.parser;
012:
013: /**
014: *
015: */
016: public abstract class SchemaVariableModifierSet {
017:
018: private boolean strict = false;
019: private boolean rigid = false;
020: private boolean list = false;
021:
022: public boolean list() {
023: return list;
024: }
025:
026: protected boolean listEnabled() {
027: return false;
028: }
029:
030: public boolean rigid() {
031: return rigid;
032: }
033:
034: protected boolean rigidEnabled() {
035: return false;
036: }
037:
038: public boolean strict() {
039: return strict;
040: }
041:
042: protected boolean strictEnabled() {
043: return false;
044: }
045:
046: /**
047: * @return <code>true</code> iff <code>option</code> is a valid modifier
048: * for the considered kind of schema variables
049: */
050: public boolean addModifier(String option) {
051: if ("strict".equals(option)) {
052: return addStrict();
053: } else if ("rigid".equals(option)) {
054: return addRigid();
055: } else if ("list".equals(option)) {
056: return addList();
057: }
058:
059: return false;
060: }
061:
062: public boolean addList() {
063: this .list = true;
064: return listEnabled();
065: }
066:
067: public boolean addRigid() {
068: this .rigid = true;
069: return rigidEnabled();
070: }
071:
072: public boolean addStrict() {
073: this .strict = true;
074: return strictEnabled();
075: }
076:
077: public static class ProgramSV extends SchemaVariableModifierSet {
078: protected boolean listEnabled() {
079: return true;
080: }
081: }
082:
083: public static class TermSV extends SchemaVariableModifierSet {
084: protected boolean rigidEnabled() {
085: return true;
086: }
087:
088: protected boolean strictEnabled() {
089: return true;
090: }
091: }
092:
093: public static class FormulaSV extends SchemaVariableModifierSet {
094: protected boolean rigidEnabled() {
095: return true;
096: }
097: }
098:
099: public static class VariableSV extends SchemaVariableModifierSet {
100: }
101:
102: public static class SkolemTermSV extends SchemaVariableModifierSet {
103: }
104:
105: public static class ListSV extends SchemaVariableModifierSet {
106: protected boolean listEnabled() {
107: return true;
108: }
109: }
110: }
|