コード例 #1
0
        private bool ParseFunction(List <CefCppFunctionNode> functions)
        {
            var f = new CefCppFunctionNode();

            Mark();

            var hasConfig = ParseCefConfig(f.CefConfig);

            while (
                Skip("virtual") ||
                Scan("static", () => f.IsStatic = true)
                )
            {
                ;
            }

            var success =
                ParseReturnType(f) &&
                Scan(@"\w+", () => f.Name = Value) &&
                Skip(@"\(");

            if (success)
            {
                while (ParseParameter(f.BooleanParameters))
                {
                    Skip(",");
                }
                Ensure(Skip(@"\)"));
                Ensure(Skip(";") || Skip(@"=\s*0;") || Skip(@"{.*?}", RegexOptions.Singleline));
                if (hasConfig)
                {
                    // only functions with the --cef(...)-- tag have a c-api counterpart.
                    functions.Add(f);
                }
            }

            Unmark(success);
            return(success);
        }
コード例 #2
0
 private bool ParseReturnType(CefCppFunctionNode f)
 {
     return
         (Scan("bool", () => f.IsRetvalBoolean = true) ||
          SkipType());
 }