String Types

  1. String Types

The following EBNF describes the different ASCII Character formats for strings.

Syntax - Standard Characters

<Word> := (a-zA-Z0-9_)(a-zA-Z0-9_-.)*
; Alphanumeric characters with optional
; period ".", dash "-" and/or
; underscore "_" characters.
; A period character may not be followed by
; another period character.
; No white space characters are permitted.
<SimpleWord> := (a-zA-Z0-9)(a-zA-Z0-9_-)*
; A word that cannot contain a period character.
<ToolWord> := (A-Z)(a-zA-Z0-9)*
; Alphanumeric characters. white space characters
; are not permitted.
<Chars> := (a-zA-Z0-9_)
<Digit> := (0-9)
<NonDigit> := (a-zA-Z_)
<AsciiChars> := (0x21 - 0x7E)
<EscapeSequence> := "\\" {"n"} {"t"} {"f"} {"r"} {"b"} {"0"} {"\\"} {<DblQuote>} {"x"}
<MACRO> := (A-Z)(A-Z0-9_)*
<MACROVAL> := "$(" <MACRO> ")"

Syntax - File and Path Names

<Extension> := (a-zA-Z0-9_-)+
; One or more alphanumeric characters.
<File> := <Word> ["." <Extension>]
<PATH> := [<MACROVAL> <FileSep>] <RelativePath>
<RelativePath> := <DirName> [<FileSep> <DirName>]*
<DirName> := {<Word>} {<MACROVAL>}
<FullFilename> := <PATH> <FileSep> <File>
<Filename> := [<PATH> <FileSep>] <File>

Syntax - C Style

<Identifier> := <NonDigit> <Chars>\*
<CName> := <Identifier>
; A valid C variable name.
<CChars> := [{0x21} {(0x23 - 0x5B)} {(0x5D - 0x7E)} {<EscapeSequence>}]*
<AsciiString> := [ <TS>* <AsciiChars>* ]*
<EmptyString> := <DblQuote> <DblQuote>
<CFlags> := <AsciiString>
<PrintChars> := {<TS>} {<CChars>}
<QuotedString> := <DblQuote> <PrintChars>* <DblQuote>
<CString> := ["L"] <QuotedString>
<NormalizedString> := <DblQuote> [{<Word>} {<Space>}]+ <DblQuote>
<GlobalComment> := <WS> "#" [<AsciiString>] <EOL>+
<Comment> := <TS> "#" <AsciiString> <EOL>+
<UnicodeString> := "L" <QuotedString>
<PcdName> := <TokenSpaceGuidCName> "." <PcdCName>
<PcdCName> := <CName>
<TokenSpaceGuidCName> := <CName>
<PCDVAL> := "PCD(" <PcdName> ")"
<ModuleType> := {"BASE"} {"SEC"} {"PEI_CORE"} {"PEIM"}
<ModuleTypeList> := <ModuleType> [" " <ModuleType>]*
<IdentifierName> := <TS> {<MACROVAL>} {<PcdName>} <TS>
<OA> := (a-zA-Z)(a-zA-Z0-9)*
<arch> := {"IA32"} {"X64"} {"IPF"} {"EBC"} {<OA>} {"common"}

Parameter Definitions


When the <UnicodeString> element (these characters are string literals as defined by the C99 specification: L"string", not actual Unicode characters) is included in a value, the build tools may be required to expand the ASCII string between the quotation marks into a valid UCS-2 encoded string. The build tools parser must treat all content between the field separators (excluding white space characters around the field separators) as ASCII literal content when generating the AutoGen.c and AutoGen.h files.


Strings that appear in comments may be ignored by the build tools. An ASCII string matching the format of the ASCII string defined by <UnicodeString> (L"Foo", for example) that appears in a comment must never be expanded by any tool.


A word that is a valid C variable that specifies the name space for a particular PCD.


A word that is a valid C variable that specifies the name of the token number which a member of the name space specified by the TokenSpaceGuidCName.


The combination of the TokenSpaceGuidCName and PcdCName values, joined by the period character as in:



CFlags refers to a string of valid arguments appended to the command line of any third party or provided tool. It is not limited to just a compiler executable tool. MACRO values that appear in quoted strings in CFlags content must not be expanded by parsing tools.


Other Architecture - One or more user defined target architectures, such as ARM or PPC. The architectures listed here must have a corresponding entry in the EDK II meta-data file, Conf/tools_def.txt. Only IA32, X64 and EBC are routinely validated.