inctokenizer = getStreamTokenizer(include_filename); if (inctokenizer!=null) processPorts(template, inctokenizer, include_filename);
public static void processPorts(DBTemplate template, StreamTokenizer tokenizer, String fileName) throws Exception {	String name;	String value;	String description;	String include_filename;	String comment = nullString;	StreamTokenizer inctokenizer = null;		if (template!=null)		/********************** ports area *************************/			while (tokenizer.nextToken() != tokenizer.TT_EOF) 		if (tokenizer.ttype == tokenizer.TT_WORD) 			if (tokenizer.sval.equals(ENDSTR)) break;			else if (tokenizer.sval.startsWith(DBConstants.commentString)) 				comment+=processComment(null, tokenizer, fileName);			else if (tokenizer.sval.equalsIgnoreCase(PORT)) {				// read name				tokenizer.nextToken();				if ((tokenizer.ttype == tokenizer.TT_WORD) ||					(tokenizer.ttype == DBConstants.quoteChar)) name=tokenizer.sval;				else throw (new DBParseException("Invalid port name...", tokenizer, fileName));									// read field				tokenizer.nextToken();				if ((tokenizer.ttype == tokenizer.TT_WORD) ||					(tokenizer.ttype == DBConstants.quoteChar)) value=tokenizer.sval;				else throw (new DBParseException("Invalid port value...", tokenizer, fileName));				// read optional description				description = null;				tokenizer.nextToken();				if (tokenizer.ttype == DBConstants.quoteChar) description=tokenizer.sval;				else					tokenizer.pushBack();				//System.out.println("\tport("+name+", \""+value+"\", \""+description+"\")");				DBPort port = new DBPort(name, value);				port.setComment(comment); comment = nullString;				port.setDescription(description);								template.addPort(port);			}			else if (tokenizer.sval.equalsIgnoreCase(INCLUDE)) {				// read incude_filename				tokenizer.nextToken();				if (tokenizer.ttype == DBConstants.quoteChar) include_filename=tokenizer.sval;				else throw (new DBParseException("Invalid include filename...", tokenizer, fileName));				// if not absulute fileName, do not use relative path				if (!(include_filename.charAt(0)=='/' || include_filename.charAt(0)=='\\' || (include_filename.length()>1 && include_filename.charAt(1)==':')))					include_filename = com.cosylab.vdct.util.StringUtils.replaceFileName(fileName, include_filename);				inctokenizer = getStreamTokenizer(include_filename);				if (inctokenizer!=null) processPorts(template, inctokenizer, include_filename);			}								/***********************************************************/}