JET

edu.utep.cs.jet.gui.tester
Class Parser

java.lang.Object
  extended by edu.utep.cs.jet.gui.tester.DefaultTester
      extended by edu.utep.cs.jet.gui.tester.Parser
All Implemented Interfaces:
Tester

public class Parser
extends DefaultTester

This class separates the JML requirements from the whole code. The Parser object contains a file and a syntax document, and it uses it for the process of separation. It returns the JML requirements according to the method that the user selects.


Field Summary
 
Fields inherited from interface edu.utep.cs.jet.gui.Constants
CLASS_EXTENSION, COLOR_EXPLORER, COLOR_OUTPUT, COPYRIGHT, DEBUG, EDIT_MENU_NAME, EXPLORER_DIR, EXPLORER_ROOT, FILE_MENU_NAME, HELP_MENU_NAME, ICON_ABOUT, ICON_ABSTRACT_CLASS, ICON_BROWSER, ICON_CLASS, ICON_CLASS_DISABLED, ICON_DELETE, ICON_ERROR, ICON_FILE, ICON_FOLDER, ICON_GEN_APP, ICON_HOME, ICON_INFORM, ICON_INTERFACE, ICON_JAVA_FILE, ICON_JML_LOGO, ICON_METHOD, ICON_METHOD_GREEN, ICON_METHOD_ORANGE, ICON_METHOD_RED, ICON_MINER, ICON_NEW, ICON_NEWTESTSUITE, ICON_NOTE, ICON_OPEN, ICON_OUTPUT, ICON_PREFERENCES, ICON_QUESTION, ICON_REDO, ICON_SAVE_AS, ICON_TEST_FILE, ICON_UNDO, ICON_UNKOWN, ICON_WARN, JAVA, JAVA_EXTENSION, JAVAC, JUNIT_SWINGGUI_TESTRUNNER, NEWLINE, OPTION_MENU_NAME, TEST_MENU_NAME, TITLE, TOOL_MENU_NAME, VERSION, WEB_PAGE_LOCATION, WEB_PAGE_NAME, WINDOW_HEIGHT, WINDOW_MIN_HEIGHT, WINDOW_MIN_WIDTH, WINDOW_WIDTH
 
Constructor Summary
Parser(File file)
          Constructor that receives the current file displayed in the editor, and a document.
 
Method Summary
static String createMethodSignature(Member meth)
          Creates a method signature from a Member type.
static String isInString(String word, String separator)
          Method that checks if the method signature generated from the Member attribute is a substring of a code's line .
static String specification(Member meth)
          This method is called whenever is necessary to separate the JML requirements from the source code.
 
Methods inherited from class edu.utep.cs.jet.gui.tester.DefaultTester
addClassFileChangeListener, createTestCaseGenerationListener, createTestMenu, doTest, doTest, enableStatDialog, getExplorerView, getOptionPanel, getPopTest, getPopTestAll, getPopTestDeclared, getPopTestInherited, getView, loadFile, setDropTarget, setHideViewAction, setSourceCodeViewer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Parser

public Parser(File file)
Constructor that receives the current file displayed in the editor, and a document.

Method Detail

specification

public static String specification(Member meth)
                            throws IOException,
                                   BadLocationException
This method is called whenever is necessary to separate the JML requirements from the source code. It receives as parameter the method that the user selects as a Member type. It returns the JML requirements from a given method.

Parameters:
meth -
Returns:
specification
Throws:
IOException
BadLocationException

createMethodSignature

public static String createMethodSignature(Member meth)
Creates a method signature from a Member type.


isInString

public static String isInString(String word,
                                String separator)
Method that checks if the method signature generated from the Member attribute is a substring of a code's line .


JET

JET is Copyright (C) 2005-2008 by The University of Texas at El Paso and is distributed under the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.