コード例 #1
0
ファイル: Identifier.cpp プロジェクト: kennytm/tticomp
bool isExpected (Preprocessor &prep, String expected) {
	PreprocessorPosition pos = prep.getCurrentPosition();
	String buffer = prep.get();
	if (buffer != expected) {
		prep.startError (pos) << '\"' << expected << "\" expected instead of \""
			<< buffer << "\"." << endl;
		return false;
	}
	return true;
}
コード例 #2
0
ファイル: Identifier.cpp プロジェクト: kennytm/tticomp
String getIdentifier (Preprocessor &prep) {
	PreprocessorPosition pos = prep.getCurrentPosition();
	String buffer = prep.get();
	if (!buffer.empty()) {
		if (isIdentifierChar (buffer [0])) {
			if (buffer.length() == 1 || isIdentifierChar (buffer [1]) || isNumberChar (buffer [1]))
				return buffer;
		}
	}
	prep.startError (pos) << "Identifier expected instead of \"" << buffer << "\"." << endl;
	return "<Unknown>";
}
コード例 #3
0
ファイル: Identifier.cpp プロジェクト: kennytm/tticomp
Tag getTag (Preprocessor &prep) {
	PreprocessorPosition pos = prep.getCurrentPosition();
	String buffer = prep.get();
	if (!buffer.empty() && buffer.length() <= 4) {
		// Fill with spaces
		while (buffer.length() < 4)
			buffer += ' ';
		return (Tag &) *buffer.getChars();
	}
	prep.startError (pos) << "OpenType tag expected instead of \"" << buffer << "\"." << endl;
	return 0;
}