Loading src/com/elphel/vdt/core/tools/config/xml/XMLConfig.java +3 −2 Original line number Original line Diff line number Diff line Loading @@ -119,8 +119,7 @@ public class XMLConfig extends Config { static final String CONTEXT_TOOL_SYNTAX_ERRORS = "errors"; static final String CONTEXT_TOOL_SYNTAX_ERRORS = "errors"; static final String CONTEXT_TOOL_SYNTAX_WARNINGS= "warnings"; static final String CONTEXT_TOOL_SYNTAX_WARNINGS= "warnings"; static final String CONTEXT_TOOL_SYNTAX_INFO = "info"; static final String CONTEXT_TOOL_SYNTAX_INFO = "info"; static final String CONTEXT_TOOL_IGNORE_FILTER = "ignore"; // file path regular expression to remove libraries from source list static final String CONTEXT_LINEBLOCK_TAG = "line"; static final String CONTEXT_LINEBLOCK_TAG = "line"; static final String CONTEXT_LINEBLOCK_NAME_ATTR = "name"; static final String CONTEXT_LINEBLOCK_NAME_ATTR = "name"; Loading Loading @@ -585,6 +584,7 @@ public class XMLConfig extends Config { String toolErrors = getAttributeValue(contextNode, CONTEXT_TOOL_SYNTAX_ERRORS); String toolErrors = getAttributeValue(contextNode, CONTEXT_TOOL_SYNTAX_ERRORS); String toolWarnings = getAttributeValue(contextNode, CONTEXT_TOOL_SYNTAX_WARNINGS); String toolWarnings = getAttributeValue(contextNode, CONTEXT_TOOL_SYNTAX_WARNINGS); String toolInfo = getAttributeValue(contextNode, CONTEXT_TOOL_SYNTAX_INFO); String toolInfo = getAttributeValue(contextNode, CONTEXT_TOOL_SYNTAX_INFO); String ignoreFilter = getAttributeValue(contextNode, CONTEXT_TOOL_IGNORE_FILTER); boolean isShell=false; boolean isShell=false; if (toolShell != null){ if (toolShell != null){ Loading Loading @@ -625,6 +625,7 @@ public class XMLConfig extends Config { toolWarnings, toolWarnings, toolInfo, toolInfo, toolRunfor, toolRunfor, ignoreFilter, null, null, null, null, null); null); Loading src/com/elphel/vdt/core/tools/generators/FilteredSourceListGenerator.java 0 → 100644 +95 −0 Original line number Original line Diff line number Diff line /******************************************************************************* * Copyright (c) 2006 Elphel, Inc and Excelsior, LLC. * This file is a part of Eclipse/VDT plug-in. * Eclipse/VDT plug-in is free software; you can redistribute it and/or modify * it under the terms of 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. * * Eclipse/VDT plug-in is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with Eclipse VDT plug-in; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ package com.elphel.vdt.core.tools.generators; import java.util.ArrayList; import java.util.List; import java.util.regex.Pattern; import java.util.regex.PatternSyntaxException; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IResource; //import com.elphel.vdt.VDT; import com.elphel.vdt.VerilogUtils; import com.elphel.vdt.ui.MessageUI; //import com.elphel.vdt.core.verilog.VerilogUtils; import com.elphel.vdt.ui.variables.SelectedResourceManager; /** * Generate the file name list of dependency closure for last selected * verilog source file. * * Created: 21.02.2006 * @author Lvov Konstantin */ public class FilteredSourceListGenerator extends AbstractGenerator { // public static final String NAME = VDT.GENERATOR_ID_FILTEREDSOURCE_LIST; public static final String NAME = "FilteredSourceList"; public FilteredSourceListGenerator(String prefix, String suffix, String separator) { super(prefix, suffix, separator); } public String getName() { return NAME; } protected String[] getStringValues() { String[] file_names = null; IResource resource = SelectedResourceManager.getDefault().getChosenVerilogFile(); String ignoreFilter= SelectedResourceManager.getDefault().getFilter(); Pattern ignorePattern = null; if (ignoreFilter!=null){ try { ignorePattern=Pattern.compile(ignoreFilter); } catch (PatternSyntaxException e){ System.out.println("Error in regular expression for ignore filter: \""+ignoreFilter+"\" - ignoring"); MessageUI.error("Error in regular expression for ignore filter: \""+ignoreFilter+"\" - ignoring"); } } if (resource != null && resource.getType() == IResource.FILE) { IFile[] files = VerilogUtils.getDependencies((IFile)resource); // returned just the same x353_1.tf List<String> fileList=new ArrayList<String>(); for (int i=0; i < files.length; i++) { String fileName=files[i].getProjectRelativePath().toOSString(); //.getName(); if ((ignorePattern!=null) &&ignorePattern.matcher(fileName).matches()) { continue; } fileList.add(fileName); } file_names=fileList.toArray(new String[0]); } else { fault("There is no selected project"); } return file_names; } } // class FilteredSourceListGenerator src/com/elphel/vdt/core/tools/params/Parameter.java +3 −0 Original line number Original line Diff line number Diff line Loading @@ -181,6 +181,9 @@ public class Parameter implements Cloneable, Updateable { } } // this.type = context.getControlInterface().findParamType(typeName); // this.type = context.getControlInterface().findParamType(typeName); if (this.context.getControlInterface()==null){ throw new ConfigException(contextInfo + ": Interface of the context is absent in "+sourceXML); } this.type = this.context.getControlInterface().findParamType(typeName); this.type = this.context.getControlInterface().findParamType(typeName); if(this.type == null) if(this.type == null) Loading src/com/elphel/vdt/core/tools/params/Tool.java +23 −2 Original line number Original line Diff line number Diff line Loading @@ -46,10 +46,10 @@ public class Tool extends Context implements Cloneable, Inheritable { private String toolWarnings; private String toolWarnings; private String toolInfo; private String toolInfo; private List<String> extensions; private List<String> extensions; private List<RunFor> runfor; private List<RunFor> runfor; private int choice; // selected variant for runfor private int choice; // selected variant for runfor private String ignoreFilter; private Tool baseTool; private Tool baseTool; Loading Loading @@ -78,6 +78,7 @@ public class Tool extends Context implements Cloneable, Inheritable { String toolWarnings, String toolWarnings, String toolInfo, String toolInfo, List<RunFor> runfor, List<RunFor> runfor, String ignoreFilter, /* never used ??? */ /* never used ??? */ List<Parameter> params, List<Parameter> params, List<ParamGroup> paramGroups, List<ParamGroup> paramGroups, Loading @@ -92,6 +93,7 @@ public class Tool extends Context implements Cloneable, Inheritable { paramGroups, paramGroups, commandLinesBlocks); commandLinesBlocks); this.runfor=runfor; // should it be cloned? this.runfor=runfor; // should it be cloned? this.ignoreFilter= ignoreFilter; this.baseToolName = baseToolName; this.baseToolName = baseToolName; this.label = label; this.label = label; this.parentPackageName = parentPackageName; this.parentPackageName = parentPackageName; Loading Loading @@ -135,6 +137,7 @@ public class Tool extends Context implements Cloneable, Inheritable { public int getChoice(){ public int getChoice(){ return choice; return choice; } } public void setChoice(int choice){ public void setChoice(int choice){ this.choice=choice; this.choice=choice; } } Loading Loading @@ -312,6 +315,24 @@ public class Tool extends Context implements Cloneable, Inheritable { } } return actualActions; return actualActions; } } // Should be called after getMenuActions to have updateContextOptions() already ran public String getIgnoreFilter(){ // calculate and get if (ignoreFilter==null) return null; FormatProcessor processor = new FormatProcessor( new Recognizer[] { new ContextParamRecognizer(this), new SimpleGeneratorRecognizer(true) // in menuMode // new SimpleGeneratorRecognizer(false) // in menuMode }); List<String> results=null; try { results=processor.process(ignoreFilter); } catch (ToolException e) { return null; } if ((results == null) || (results.size()==0)) return null; return results.get(0); } private void updateContextOptions (IProject project){ private void updateContextOptions (IProject project){ PackageContext packageContext = getParentPackage(); PackageContext packageContext = getParentPackage(); Loading src/com/elphel/vdt/core/tools/params/recognizers/ParamRepeaterRecognizer.java +4 −1 Original line number Original line Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.elphel.vdt.core.tools.params.recognizers; import com.elphel.vdt.core.tools.generators.AbstractGenerator; import com.elphel.vdt.core.tools.generators.AbstractGenerator; import com.elphel.vdt.core.tools.generators.FileListGenerator; import com.elphel.vdt.core.tools.generators.FileListGenerator; import com.elphel.vdt.core.tools.generators.FilteredSourceListGenerator; import com.elphel.vdt.core.tools.generators.SourceListGenerator; import com.elphel.vdt.core.tools.generators.SourceListGenerator; import com.elphel.vdt.core.tools.generators.TopModulesNameGenerator; import com.elphel.vdt.core.tools.generators.TopModulesNameGenerator; import com.elphel.vdt.core.tools.generators.ValueGenerator; import com.elphel.vdt.core.tools.generators.ValueGenerator; Loading @@ -40,7 +41,9 @@ public class ParamRepeaterRecognizer extends RepeaterRecognizer { if(genName.equals(ParamFormatRecognizer.FORMAT_PARAM_VALUE_MARK)) if(genName.equals(ParamFormatRecognizer.FORMAT_PARAM_VALUE_MARK)) return new ValueGenerator(param, repPrefix, repSuffix, separator); return new ValueGenerator(param, repPrefix, repSuffix, separator); /* Trying to put these here */ /* Trying to put these here */ if(genName.equals(SourceListGenerator.NAME)) if(genName.equals(FilteredSourceListGenerator.NAME)) return new FilteredSourceListGenerator(repPrefix, repSuffix, separator); else if(genName.equals(SourceListGenerator.NAME)) return new SourceListGenerator(repPrefix, repSuffix, separator); return new SourceListGenerator(repPrefix, repSuffix, separator); else if(genName.equals(FileListGenerator.NAME)) else if(genName.equals(FileListGenerator.NAME)) return new FileListGenerator(repPrefix, repSuffix, separator); return new FileListGenerator(repPrefix, repSuffix, separator); Loading Loading
src/com/elphel/vdt/core/tools/config/xml/XMLConfig.java +3 −2 Original line number Original line Diff line number Diff line Loading @@ -119,8 +119,7 @@ public class XMLConfig extends Config { static final String CONTEXT_TOOL_SYNTAX_ERRORS = "errors"; static final String CONTEXT_TOOL_SYNTAX_ERRORS = "errors"; static final String CONTEXT_TOOL_SYNTAX_WARNINGS= "warnings"; static final String CONTEXT_TOOL_SYNTAX_WARNINGS= "warnings"; static final String CONTEXT_TOOL_SYNTAX_INFO = "info"; static final String CONTEXT_TOOL_SYNTAX_INFO = "info"; static final String CONTEXT_TOOL_IGNORE_FILTER = "ignore"; // file path regular expression to remove libraries from source list static final String CONTEXT_LINEBLOCK_TAG = "line"; static final String CONTEXT_LINEBLOCK_TAG = "line"; static final String CONTEXT_LINEBLOCK_NAME_ATTR = "name"; static final String CONTEXT_LINEBLOCK_NAME_ATTR = "name"; Loading Loading @@ -585,6 +584,7 @@ public class XMLConfig extends Config { String toolErrors = getAttributeValue(contextNode, CONTEXT_TOOL_SYNTAX_ERRORS); String toolErrors = getAttributeValue(contextNode, CONTEXT_TOOL_SYNTAX_ERRORS); String toolWarnings = getAttributeValue(contextNode, CONTEXT_TOOL_SYNTAX_WARNINGS); String toolWarnings = getAttributeValue(contextNode, CONTEXT_TOOL_SYNTAX_WARNINGS); String toolInfo = getAttributeValue(contextNode, CONTEXT_TOOL_SYNTAX_INFO); String toolInfo = getAttributeValue(contextNode, CONTEXT_TOOL_SYNTAX_INFO); String ignoreFilter = getAttributeValue(contextNode, CONTEXT_TOOL_IGNORE_FILTER); boolean isShell=false; boolean isShell=false; if (toolShell != null){ if (toolShell != null){ Loading Loading @@ -625,6 +625,7 @@ public class XMLConfig extends Config { toolWarnings, toolWarnings, toolInfo, toolInfo, toolRunfor, toolRunfor, ignoreFilter, null, null, null, null, null); null); Loading
src/com/elphel/vdt/core/tools/generators/FilteredSourceListGenerator.java 0 → 100644 +95 −0 Original line number Original line Diff line number Diff line /******************************************************************************* * Copyright (c) 2006 Elphel, Inc and Excelsior, LLC. * This file is a part of Eclipse/VDT plug-in. * Eclipse/VDT plug-in is free software; you can redistribute it and/or modify * it under the terms of 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. * * Eclipse/VDT plug-in is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with Eclipse VDT plug-in; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ package com.elphel.vdt.core.tools.generators; import java.util.ArrayList; import java.util.List; import java.util.regex.Pattern; import java.util.regex.PatternSyntaxException; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IResource; //import com.elphel.vdt.VDT; import com.elphel.vdt.VerilogUtils; import com.elphel.vdt.ui.MessageUI; //import com.elphel.vdt.core.verilog.VerilogUtils; import com.elphel.vdt.ui.variables.SelectedResourceManager; /** * Generate the file name list of dependency closure for last selected * verilog source file. * * Created: 21.02.2006 * @author Lvov Konstantin */ public class FilteredSourceListGenerator extends AbstractGenerator { // public static final String NAME = VDT.GENERATOR_ID_FILTEREDSOURCE_LIST; public static final String NAME = "FilteredSourceList"; public FilteredSourceListGenerator(String prefix, String suffix, String separator) { super(prefix, suffix, separator); } public String getName() { return NAME; } protected String[] getStringValues() { String[] file_names = null; IResource resource = SelectedResourceManager.getDefault().getChosenVerilogFile(); String ignoreFilter= SelectedResourceManager.getDefault().getFilter(); Pattern ignorePattern = null; if (ignoreFilter!=null){ try { ignorePattern=Pattern.compile(ignoreFilter); } catch (PatternSyntaxException e){ System.out.println("Error in regular expression for ignore filter: \""+ignoreFilter+"\" - ignoring"); MessageUI.error("Error in regular expression for ignore filter: \""+ignoreFilter+"\" - ignoring"); } } if (resource != null && resource.getType() == IResource.FILE) { IFile[] files = VerilogUtils.getDependencies((IFile)resource); // returned just the same x353_1.tf List<String> fileList=new ArrayList<String>(); for (int i=0; i < files.length; i++) { String fileName=files[i].getProjectRelativePath().toOSString(); //.getName(); if ((ignorePattern!=null) &&ignorePattern.matcher(fileName).matches()) { continue; } fileList.add(fileName); } file_names=fileList.toArray(new String[0]); } else { fault("There is no selected project"); } return file_names; } } // class FilteredSourceListGenerator
src/com/elphel/vdt/core/tools/params/Parameter.java +3 −0 Original line number Original line Diff line number Diff line Loading @@ -181,6 +181,9 @@ public class Parameter implements Cloneable, Updateable { } } // this.type = context.getControlInterface().findParamType(typeName); // this.type = context.getControlInterface().findParamType(typeName); if (this.context.getControlInterface()==null){ throw new ConfigException(contextInfo + ": Interface of the context is absent in "+sourceXML); } this.type = this.context.getControlInterface().findParamType(typeName); this.type = this.context.getControlInterface().findParamType(typeName); if(this.type == null) if(this.type == null) Loading
src/com/elphel/vdt/core/tools/params/Tool.java +23 −2 Original line number Original line Diff line number Diff line Loading @@ -46,10 +46,10 @@ public class Tool extends Context implements Cloneable, Inheritable { private String toolWarnings; private String toolWarnings; private String toolInfo; private String toolInfo; private List<String> extensions; private List<String> extensions; private List<RunFor> runfor; private List<RunFor> runfor; private int choice; // selected variant for runfor private int choice; // selected variant for runfor private String ignoreFilter; private Tool baseTool; private Tool baseTool; Loading Loading @@ -78,6 +78,7 @@ public class Tool extends Context implements Cloneable, Inheritable { String toolWarnings, String toolWarnings, String toolInfo, String toolInfo, List<RunFor> runfor, List<RunFor> runfor, String ignoreFilter, /* never used ??? */ /* never used ??? */ List<Parameter> params, List<Parameter> params, List<ParamGroup> paramGroups, List<ParamGroup> paramGroups, Loading @@ -92,6 +93,7 @@ public class Tool extends Context implements Cloneable, Inheritable { paramGroups, paramGroups, commandLinesBlocks); commandLinesBlocks); this.runfor=runfor; // should it be cloned? this.runfor=runfor; // should it be cloned? this.ignoreFilter= ignoreFilter; this.baseToolName = baseToolName; this.baseToolName = baseToolName; this.label = label; this.label = label; this.parentPackageName = parentPackageName; this.parentPackageName = parentPackageName; Loading Loading @@ -135,6 +137,7 @@ public class Tool extends Context implements Cloneable, Inheritable { public int getChoice(){ public int getChoice(){ return choice; return choice; } } public void setChoice(int choice){ public void setChoice(int choice){ this.choice=choice; this.choice=choice; } } Loading Loading @@ -312,6 +315,24 @@ public class Tool extends Context implements Cloneable, Inheritable { } } return actualActions; return actualActions; } } // Should be called after getMenuActions to have updateContextOptions() already ran public String getIgnoreFilter(){ // calculate and get if (ignoreFilter==null) return null; FormatProcessor processor = new FormatProcessor( new Recognizer[] { new ContextParamRecognizer(this), new SimpleGeneratorRecognizer(true) // in menuMode // new SimpleGeneratorRecognizer(false) // in menuMode }); List<String> results=null; try { results=processor.process(ignoreFilter); } catch (ToolException e) { return null; } if ((results == null) || (results.size()==0)) return null; return results.get(0); } private void updateContextOptions (IProject project){ private void updateContextOptions (IProject project){ PackageContext packageContext = getParentPackage(); PackageContext packageContext = getParentPackage(); Loading
src/com/elphel/vdt/core/tools/params/recognizers/ParamRepeaterRecognizer.java +4 −1 Original line number Original line Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.elphel.vdt.core.tools.params.recognizers; import com.elphel.vdt.core.tools.generators.AbstractGenerator; import com.elphel.vdt.core.tools.generators.AbstractGenerator; import com.elphel.vdt.core.tools.generators.FileListGenerator; import com.elphel.vdt.core.tools.generators.FileListGenerator; import com.elphel.vdt.core.tools.generators.FilteredSourceListGenerator; import com.elphel.vdt.core.tools.generators.SourceListGenerator; import com.elphel.vdt.core.tools.generators.SourceListGenerator; import com.elphel.vdt.core.tools.generators.TopModulesNameGenerator; import com.elphel.vdt.core.tools.generators.TopModulesNameGenerator; import com.elphel.vdt.core.tools.generators.ValueGenerator; import com.elphel.vdt.core.tools.generators.ValueGenerator; Loading @@ -40,7 +41,9 @@ public class ParamRepeaterRecognizer extends RepeaterRecognizer { if(genName.equals(ParamFormatRecognizer.FORMAT_PARAM_VALUE_MARK)) if(genName.equals(ParamFormatRecognizer.FORMAT_PARAM_VALUE_MARK)) return new ValueGenerator(param, repPrefix, repSuffix, separator); return new ValueGenerator(param, repPrefix, repSuffix, separator); /* Trying to put these here */ /* Trying to put these here */ if(genName.equals(SourceListGenerator.NAME)) if(genName.equals(FilteredSourceListGenerator.NAME)) return new FilteredSourceListGenerator(repPrefix, repSuffix, separator); else if(genName.equals(SourceListGenerator.NAME)) return new SourceListGenerator(repPrefix, repSuffix, separator); return new SourceListGenerator(repPrefix, repSuffix, separator); else if(genName.equals(FileListGenerator.NAME)) else if(genName.equals(FileListGenerator.NAME)) return new FileListGenerator(repPrefix, repSuffix, separator); return new FileListGenerator(repPrefix, repSuffix, separator); Loading