Use colon syntax for FQNames for enum values.
example: android.hardware.foo@1.0::IFoo.IFooInternal.FooEnum:ENUM_OK
In constant expressions they are emitted as-is, so the emit code won't
compile.
Also split regex rule 4 into two rules in FQName.cpp, to single out
the case for identifiers.
Test: not tested. This CL require child CLs to work.
Bug: 31682916
Change-Id: Ib376dc8c4a27894f7b0eb6d017d9f69242d25b45
diff --git a/hidl-gen_l.ll b/hidl-gen_l.ll
index 431ea12..8a52137 100644
--- a/hidl-gen_l.ll
+++ b/hidl-gen_l.ll
@@ -147,6 +147,10 @@
{COMPONENT}({DOT}{COMPONENT})+ { yylval->str = strdup(yytext); return token::FQNAME; }
{COMPONENT} { yylval->str = strdup(yytext); return token::IDENTIFIER; }
+{PATH}{VERSION}?"::"{PATH}":"{COMPONENT} { yylval->str = strdup(yytext); return token::FQNAME; }
+{VERSION}"::"{PATH}":"{COMPONENT} { yylval->str = strdup(yytext); return token::FQNAME; }
+{PATH}":"{COMPONENT} { yylval->str = strdup(yytext); return token::FQNAME; }
+
0[xX]{H}+{IS}? { yylval->str = strdup(yytext); return token::INTEGER; }
0{D}+{IS}? { yylval->str = strdup(yytext); return token::INTEGER; }
{D}+{IS}? { yylval->str = strdup(yytext); return token::INTEGER; }