MCPcopy Create free account
hub / github.com/OpenMW/openmw / parseExpression

Method parseExpression

components/compiler/lineparser.cpp:19–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17namespace Compiler
18{
19 void LineParser::parseExpression(Scanner& scanner, const TokenLoc& loc)
20 {
21 mExprParser.reset();
22
23 if (!mExplicit.empty())
24 {
25 mExprParser.parseName(mExplicit, loc, scanner);
26 if (mState == MemberState)
27 mExprParser.parseSpecial(Scanner::S_member, loc, scanner);
28 else
29 mExprParser.parseSpecial(Scanner::S_ref, loc, scanner);
30 }
31
32 scanner.scan(mExprParser);
33
34 char type = mExprParser.append(mCode);
35 mState = EndState;
36
37 switch (type)
38 {
39 case 'l':
40
41 Generator::report(mCode, mLiterals, "%d");
42 break;
43
44 case 'f':
45
46 Generator::report(mCode, mLiterals, "%f");
47 break;
48
49 default:
50
51 throw std::runtime_error("Unknown expression result type");
52 }
53 }
54
55 LineParser::LineParser(ErrorHandler& errorHandler, const Context& context, Locals& locals, Literals& literals,
56 std::vector<Interpreter::Type_Code>& code, bool allowExpression)

Callers

nothing calls this directly

Calls 7

reportFunction · 0.85
scanMethod · 0.80
resetMethod · 0.45
emptyMethod · 0.45
parseNameMethod · 0.45
parseSpecialMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected