Пример #1
0
        /// <summary>
        /// 解析常量数组
        /// </summary>
        /// <param name="json"></param>
        /// <param name="type"></param>
        private object ParseScalarArray(string json, string type)
        {
            var jsonLexer  = new JsonLexer(new AntlrInputStream(json));
            var jsonParser = new JsonParser(new CommonTokenStream(jsonLexer));

            var jsonValue = jsonParser.jsonValue();

            if (jsonValue == null)
            {
                ErrorTracking.LogError("", "无法解析成一个Json.", 0, 0);
                return(null);
            }

            if (jsonValue.arraryValue != null)
            {
                foreach (var element in jsonValue.arraryValue._arrayElement)
                {
                }
            }

            return(null);
        }
Пример #2
0
 /// <summary>
 /// 记录错误
 /// </summary>
 public static void LogError(string filePath, int row, int col, string text)
 {
     ErrorTracking.LogError(filePath, filePath + " <" + FormatIndex(row, col) + "> " + text, -1, -1);
 }