code.append("pattern.SetIgnore("); if (pattern.getIgnoreMessage() != null) {
if (pattern.getIgnoreMessage() == null) { code.append("pattern.Ignore = True"); } else { code.append("pattern.IgnoreMessage = ");
    public void addToken(TokenPattern pattern,                         VisualBasicConstantsFile constants) {        StringBuffer  code = new StringBuffer();        String        str;        // Create new pattern        code.append("pattern = New TokenPattern(CInt(");        code.append(constants.getConstant(pattern.getId()));        code.append("), \"");        code.append(pattern.getName());        code.append("\", TokenPattern.PatternType.");        switch (pattern.getType()) {        case TokenPattern.STRING_TYPE:            code.append("STRING");            break;        case TokenPattern.REGEXP_TYPE:            code.append("REGEXP");            break;        }        code.append(", ");        str = pattern.getPattern();        code.append(gen.getCodeStyle().getStringConstant(str, '"'));        code.append(")\n");        // Add error and ignore messages        if (pattern.isError()) {            code.append("pattern.SetError(");            if (pattern.getErrorMessage() != null) {                str = pattern.getErrorMessage();                code.append(gen.getCodeStyle().getStringConstant(str, '"'));            }            code.append(")\n");        }        if (pattern.isIgnore()) {            code.append("pattern.SetIgnore(");            if (pattern.getIgnoreMessage() != null) {                str = pattern.getIgnoreMessage();                code.append(gen.getCodeStyle().getStringConstant(str, '"'));            }            code.append(")\n");        }        // Add pattern to tokenizer        code.append("AddPattern(pattern)");        initMethod.addCode("");        initMethod.addCode(code.toString());    }