当前位置: 首页>>代码示例>>C++>>正文


C++ Lexer::eatLine方法代码示例

本文整理汇总了C++中Lexer::eatLine方法的典型用法代码示例。如果您正苦于以下问题:C++ Lexer::eatLine方法的具体用法?C++ Lexer::eatLine怎么用?C++ Lexer::eatLine使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Lexer的用法示例。


在下文中一共展示了Lexer::eatLine方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: readCiteFormat

void TextClass::readCiteFormat(Lexer & lexrc)
{
	string etype;
	string definition;
	while (lexrc.isOK()) {
		lexrc.next();
		etype = lexrc.getString();
		if (!lexrc.isOK() || compare_ascii_no_case(etype, "end") == 0)
			break;
		lexrc.eatLine();
		definition = lexrc.getString();
		char initchar = etype[0];
		if (initchar == '#')
			continue;
		if (initchar == '!' || initchar == '_')
			cite_macros_[etype] = definition;
		else
			cite_formats_[etype] = definition;
	}
}
开发者ID:bsjung,项目名称:Lyx,代码行数:20,代码来源:TextClass.cpp

示例2: read

void ParagraphParameters::read(Lexer & lex, bool merge)
{
	if (!merge)
		clear();
	while (lex.isOK()) {
		lex.nextToken();
		string const token = lex.getString();

		if (token.empty())
			continue;

		if (token[0] != '\\') {
			lex.pushToken(token);
			break;
		}

		if (token == "\\noindent") {
			noindent(true);
		} else if (token == "\\indent") {
			//not found in LyX files but can be used with lfuns
			noindent(false);
		} else if (token == "\\indent-toggle") {
			//not found in LyX files but can be used with lfuns
			noindent(!noindent());
		} else if (token == "\\leftindent") {
			lex.next();
			Length value(lex.getString());
			leftIndent(value);
		} else if (token == "\\start_of_appendix") {
			startOfAppendix(true);
		} else if (token == "\\paragraph_spacing") {
			lex.next();
			string const tmp = rtrim(lex.getString());
			if (tmp == "default") {
				//not found in LyX files but can be used with lfuns
				spacing(Spacing(Spacing::Default));
			} else if (tmp == "single") {
				spacing(Spacing(Spacing::Single));
			} else if (tmp == "onehalf") {
				spacing(Spacing(Spacing::Onehalf));
			} else if (tmp == "double") {
				spacing(Spacing(Spacing::Double));
			} else if (tmp == "other") {
				lex.next();
				spacing(Spacing(Spacing::Other,
						 lex.getString()));
			} else {
				lex.printError("Unknown spacing token: '$$Token'");
			}
		} else if (token == "\\align") {
			lex.next();
			int tmpret = findToken(string_align, lex.getString());
			if (tmpret == -1)
				++tmpret;
			align(LyXAlignment(1 << tmpret));
		} else if (token == "\\labelwidthstring") {
			lex.eatLine();
			labelWidthString(lex.getDocString());
		} else {
			lex.pushToken(token);
			break;
		}
	}
}
开发者ID:,项目名称:,代码行数:64,代码来源:

示例3: read


//.........这里部分代码省略.........
                TextClass::InsetLayouts::const_iterator len =
                    tclass.insetLayouts().end();
                for (; lit != len; ++lit)
                    lyxerr << lit->second.name() << "\n";
            }
            break;
        }

        case IL_FONT: {
            font_ = lyxRead(lex, inherit_font);
            // If you want to define labelfont, you need to do so after
            // font is defined.
            labelfont_ = font_;
            break;
        }
        case IL_RESETARGS:
            bool reset;
            lex >> reset;
            if (reset)
                latexargs_.clear();
            break;
        case IL_ARGUMENT:
            readArgument(lex);
            break;
        case IL_BGCOLOR:
            lex >> tmp;
            bgcolor_ = lcolor.getFromLyXName(tmp);
            break;
        case IL_PREAMBLE:
            preamble_ = from_utf8(lex.getLongString("EndPreamble"));
            break;
        case IL_BABELPREAMBLE:
            babelpreamble_ = from_utf8(lex.getLongString("EndBabelPreamble"));
            break;
        case IL_LANGPREAMBLE:
            langpreamble_ = from_utf8(lex.getLongString("EndLangPreamble"));
            break;
        case IL_REFPREFIX:
            lex >> refprefix_;
            break;
        case IL_HTMLTAG:
            lex >> htmltag_;
            break;
        case IL_HTMLATTR:
            lex >> htmlattr_;
            break;
        case IL_HTMLFORCECSS:
            lex >> htmlforcecss_;
            break;
        case IL_HTMLINNERTAG:
            lex >> htmlinnertag_;
            break;
        case IL_HTMLINNERATTR:
            lex >> htmlinnerattr_;
            break;
        case IL_HTMLLABEL:
            lex >> htmllabel_;
            break;
        case IL_HTMLISBLOCK:
            lex >> htmlisblock_;
            break;
        case IL_HTMLSTYLE:
            htmlstyle_ = from_utf8(lex.getLongString("EndHTMLStyle"));
            break;
        case IL_HTMLPREAMBLE:
            htmlpreamble_ = from_utf8(lex.getLongString("EndPreamble"));
            break;
        case IL_REQUIRES: {
            lex.eatLine();
            vector<string> const req
                = support::getVectorFromString(lex.getString());
            requires_.insert(req.begin(), req.end());
            break;
        }
        case IL_SPELLCHECK:
            lex >> spellcheck_;
            break;
        case IL_RESETSFONT:
            lex >> resetsfont_;
            break;
        case IL_DISPLAY:
            lex >> display_;
            break;
        case IL_END:
            getout = true;
            break;
        }
    }

    // Here add element to list if getout == true
    if (!getout)
        return false;

    // The label font is generally used as-is without
    // any realization against a given context.
    labelfont_.realize(sane_font);

    lex.popTable();
    return true;
}
开发者ID:yiran06,项目名称:lyx,代码行数:101,代码来源:InsetLayout.cpp

示例4: read


//.........这里部分代码省略.........

		case TC_PREAMBLE:
			preamble_ = from_utf8(lexrc.getLongString("EndPreamble"));
			break;

		case TC_HTMLPREAMBLE:
			htmlpreamble_ = from_utf8(lexrc.getLongString("EndPreamble"));
			break;
		
		case TC_HTMLTOCSECTION:
			html_toc_section_ = from_utf8(trim(lexrc.getString()));
			break;

		case TC_ADDTOPREAMBLE:
			preamble_ += from_utf8(lexrc.getLongString("EndPreamble"));
			break;

		case TC_ADDTOHTMLPREAMBLE:
			htmlpreamble_ += from_utf8(lexrc.getLongString("EndPreamble"));
			break;

		case TC_PROVIDES: {
			lexrc.next();
			string const feature = lexrc.getString();
			lexrc.next();
			if (lexrc.getInteger())
				provides_.insert(feature);
			else
				provides_.erase(feature);
			break;
		}

		case TC_REQUIRES: {
			lexrc.eatLine();
			vector<string> const req 
				= getVectorFromString(lexrc.getString());
			requires_.insert(req.begin(), req.end());
			break;
		}

		case TC_DEFAULTMODULE: {
			lexrc.next();
			string const module = lexrc.getString();
			if (find(default_modules_.begin(), default_modules_.end(), module) == default_modules_.end())
				default_modules_.push_back(module);
			break;
		}

		case TC_PROVIDESMODULE: {
			lexrc.next();
			string const module = lexrc.getString();
			if (find(provided_modules_.begin(), provided_modules_.end(), module) == provided_modules_.end())
				provided_modules_.push_back(module);
			break;
		}

		case TC_EXCLUDESMODULE: {
			lexrc.next();
			string const module = lexrc.getString();
			// modules already have their own way to exclude other modules
			if (rt == MODULE) {
				LYXERR0("ExcludesModule tag cannot be used in a module!");
				break;
			}
			if (find(excluded_modules_.begin(), excluded_modules_.end(), module) == excluded_modules_.end())
				excluded_modules_.push_back(module);
开发者ID:bsjung,项目名称:Lyx,代码行数:67,代码来源:TextClass.cpp


注:本文中的Lexer::eatLine方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。