TextFormats is a software system for efficient and user-friendly creation of text format specifications, accessible from multiple programming languages (C/C++, Python, Nim) and the Unix command line. To work with a format, a specification written in the TextFormats Specification Language (TFSL) must be created. The specification defines datatypes for each part of the format. The syntax for datatype definitions in TextFormats specifications is based on the text representation. Thus this system is well suited for the description of existing formats. However, when creating a new text format for representing existing data, the user may use different possible definitions, based on the type of value and the representation choices. This study explores the possible definition syntax in the TextFormats Specification Language to be used for creating text representations of scalar values (e.g. string, numeric value, boolean) and compound data structures (e.g. array, mapping). The results of the analysis are presented systematically, together with examples for each each type of different values that can be represented, and usage advices.
翻译:文本格式是一个软件系统,用于高效率和方便用户地创建文本格式规格,可从多种编程语言(C/C++、Python、Nim)和 Unix 命令行(C/C++、Python、Nim)中调阅。要使用格式,必须创建文本格式指定语言(TFSL)中写入的规格。规格为格式的每个部分定义了数据类型。文本格式规格中的数据类型定义的语法基于文本格式的描述。因此,这个系统非常适合现有格式的描述。但是,在为代表现有数据创建新的文本格式时,用户可以使用不同的可能的定义,这些定义基于值的类型和表示选择。本研究报告探索了文本格式指定语言中可能的定义语法,用于创建卡力值的文本表达方式(例如字符串、数字值、布林)和复合数据结构(例如阵列、绘图),分析结果会系统化,同时提供每种不同值的示例以及使用建议。