--- /dev/null
+/*\r
+ * \r
+ * Copyright 2002-2004 The Ant-Contrib project\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+package net.sf.antcontrib.cpptasks.borland;\r
+import net.sf.antcontrib.cpptasks.parser.AbstractParser;\r
+import net.sf.antcontrib.cpptasks.parser.AbstractParserState;\r
+import net.sf.antcontrib.cpptasks.parser.FilenameState;\r
+public class CfgFilenameState extends FilenameState {\r
+ private char terminator;\r
+ public CfgFilenameState(AbstractParser parser, char[] terminators) {\r
+ super(parser, terminators);\r
+ terminator = terminators[0];\r
+ }\r
+ public AbstractParserState consume(char ch) {\r
+ //\r
+ // if a ';' is encountered then\r
+ // close the previous filename by sending a\r
+ // recognized terminator to our super class\r
+ // and stay in this state for more filenamese\r
+ if (ch == ';') {\r
+ super.consume(terminator);\r
+ return this;\r
+ }\r
+ AbstractParserState newState = super.consume(ch);\r
+ //\r
+ // change null (consume to end of line)\r
+ // to look for next switch character\r
+ if (newState == null) {\r
+ newState = getParser().getNewLineState();\r
+ }\r
+ return newState;\r
+ }\r
+}\r