[llvm-rc] Add integer expressions parsing ability. [7/8]

This allows the ints to be written as integer expressions evaluating to
unsigned 16-bit/32-bit integers.

All the expressions may use the following operators: + - & | ~, and
parentheses. Minus token - can be also unary. There is no precedence of
the operators other than the unary operators binding stronger than their
binary counterparts.

Differential Revision: https://reviews.llvm.org/D37022

llvm-svn: 314477
diff --git a/llvm/tools/llvm-rc/ResourceScriptParser.h b/llvm/tools/llvm-rc/ResourceScriptParser.h
index 132106f..56042f7 100644
--- a/llvm/tools/llvm-rc/ResourceScriptParser.h
+++ b/llvm/tools/llvm-rc/ResourceScriptParser.h
@@ -77,12 +77,18 @@
 
   // The following methods try to read a single token, check if it has the
   // correct type and then parse it.
+  // Each integer can be written as an arithmetic expression producing an
+  // unsigned 32-bit integer.
   Expected<uint32_t> readInt();            // Parse an integer.
   Expected<StringRef> readString();        // Parse a string.
   Expected<StringRef> readIdentifier();    // Parse an identifier.
   Expected<IntOrString> readIntOrString(); // Parse an integer or a string.
   Expected<IntOrString> readTypeOrName();  // Parse an integer or an identifier.
 
+  // Helper integer expression parsing methods.
+  Expected<uint32_t> parseIntExpr1();
+  Expected<uint32_t> parseIntExpr2();
+
   // Advance the state by one, discarding the current token.
   // If the discarded token had an incorrect type, fail.
   Error consumeType(Kind TokenKind);