X-Git-Url: http://plrg.eecs.uci.edu/git/?p=cdsspec-compiler.git;a=blobdiff_plain;f=src%2Fedu%2Fuci%2Feecs%2FspecCompiler%2FspecExtraction%2FSpecInfoScanner.java;fp=src%2Fedu%2Fuci%2Feecs%2FspecCompiler%2FspecExtraction%2FSpecInfoScanner.java;h=0000000000000000000000000000000000000000;hp=093ab44e0f8efb31d44434a800e67768e0712541;hb=1c06bc88ba6f7c5882d726207fa6e05e734cb1bd;hpb=c46d1e2c3835a9c637375a79b82fb36bf96116c7 diff --git a/src/edu/uci/eecs/specCompiler/specExtraction/SpecInfoScanner.java b/src/edu/uci/eecs/specCompiler/specExtraction/SpecInfoScanner.java deleted file mode 100644 index 093ab44..0000000 --- a/src/edu/uci/eecs/specCompiler/specExtraction/SpecInfoScanner.java +++ /dev/null @@ -1,67 +0,0 @@ -package edu.uci.eecs.specCompiler.specExtraction; - -import java.util.HashMap; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileReader; -import java.io.IOException; -import java.io.LineNumberReader; - -import java.util.regex.Pattern; -import java.util.regex.Matcher; - -/** - *

- * This class will scan all the input files, extract all the "special comments" - * (specifications). It should include information: 1. Beginning and end line of - * the specs; 2. The next two lines of code if it is interface constrcut. - *

- * - * @author peizhaoo - * - */ -public class SpecInfoScanner { - public final HashMap constructs; - - public SpecInfoScanner() { - constructs = new HashMap(); - } - - /** - *

- * Scan - *

- * - * @param file - */ - private void scanFile(File file) { - try { - FileReader fr = new FileReader(file); - LineNumberReader lnr = new LineNumberReader(fr); - String line = null; - // Info to keep when parsing the Spec - // 0 for default, 1 for potential sepc, 2 for in spec - int state = 0; - Pattern pBegin = Pattern.compile("^[\\s|\\t]*/**"), pEnd = Pattern - .compile("*/$"); - while ((line = lnr.readLine()) != null) { - Matcher m1 = pBegin.matcher(line); - if (m1.matches()) - state = 1; // Go to 'potential spec' state - if (state == 1) { - - } - } - } catch (FileNotFoundException e) { - e.printStackTrace(); - } catch (IOException e) { - e.printStackTrace(); - } - } - - public void scanFiles(File[] files) { - for (int i = 0; i < files.length; i++) { - scanFile(files[i]); - } - } -}