/*
 * Copyright 2014 OpenCog Foundation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package relex.output;

import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Scanner;

/**
 *
 * @author Rodas Solomon <rodisolomon@gmail.com>
 */
public class ScopeVariables
{

    private final  String scopefile = "./data/varscope.txt";
    private ArrayList<String> scope = new ArrayList();

    public ArrayList<String>  loadVarScope()
    {
        File file = new File(scopefile);
        Scanner input = null;
        try {
            input = new Scanner(file);
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
        while (input.hasNext()) {

            String nextLine = input.nextLine();
            if (null == nextLine) break;
            if (!nextLine.equals(""))
                scope.add(nextLine);

        }


        input.close();

        return getScope();
    }

    public  ArrayList<String> getScope()
    {
        ArrayList<String> sVar = new ArrayList<String>();
        String temp[];
        for( String  var: scope) {
            temp = var.substring( (var.indexOf("[") + 1), (var.indexOf("]"))).split(",");
            for( String  y : temp) {
                sVar.add(y);
            }
        }
        return sVar;
    }

}

/* ============================ END OF FILE ====================== */

@@ -824,20 +824,17 @@
 bles%0A%7B%0A%0A
-    
+%09
 private 
@@ -882,20 +882,17 @@
 e.txt%22;%0A
-    
+%09
 private 
@@ -935,20 +935,17 @@
 ist();%0A%0A
-    
+%09
 public A
@@ -977,30 +977,21 @@
 Scope()%0A
-    %7B%0A        
+%09%7B%0A%09%09
 File fil
@@ -1015,24 +1015,18 @@
 efile);%0A
-        
+%09%09
 Scanner 
@@ -1043,34 +1043,19 @@
 ll;%0A
-        try %7B%0A            
+%09%09try %7B%0A%09%09%09
 inpu
@@ -1077,24 +1077,18 @@
 (file);%0A
-        
+%09%09
 %7D catch 
@@ -1115,28 +1115,19 @@
 on e) %7B%0A
-            
+%09%09%09
 e.printS
@@ -1139,34 +1139,22 @@
 race();%0A
-        %7D%0A        
+%09%09%7D%0A%09%09
 while (i
@@ -1172,28 +1172,19 @@
 t()) %7B%0A%0A
-            
+%09%09%09
 String n
@@ -1211,28 +1211,19 @@
 Line();%0A
-            
+%09%09%09
 if (null
@@ -1243,28 +1243,19 @@
  break;%0A
-            
+%09%09%09
 if (!nex
@@ -1272,32 +1272,20 @@
 ls(%22%22))%0A
-                
+%09%09%09%09
 scope.ad
@@ -1302,28 +1302,16 @@
 );%0A%0A
-        %7D%0A%0A%0A        
+%09%09%7D%0A%0A%0A%09%09
 inpu
@@ -1322,24 +1322,18 @@
 ose();%0A%0A
-        
+%09%09
 return g
@@ -1347,19 +1347,13 @@
 ();%0A
-    %7D%0A%0A    
+%09%7D%0A%0A%09
 publ
@@ -1389,22 +1389,13 @@
 e()%0A
-    %7B%0A        
+%09%7B%0A%09%09
 Arra
@@ -1440,24 +1440,18 @@
 ing%3E();%0A
-        
+%09%09
 String t
@@ -1457,24 +1457,18 @@
 temp%5B%5D;%0A
-        
+%09%09
 for( Str
@@ -1486,28 +1486,19 @@
 cope) %7B%0A
-            
+%09%09%09
 temp = v
@@ -1567,28 +1567,19 @@
 t(%22,%22);%0A
-            
+%09%09%09
 for( Str
@@ -1599,69 +1599,36 @@
 ) %7B%0A
-                sVar.add(y);%0A            %7D%0A        %7D%0A        
+%09%09%09%09sVar.add(y);%0A%09%09%09%7D%0A%09%09%7D%0A%09%09
 retu
@@ -1636,20 +1636,17 @@
 n sVar;%0A
-    
+%09
 %7D%0A%0A%7D%0A%0A/*

correct indentation ScopeVariables.java