We focus on control constructs that allow programmers define actions to be performed when respective conditions are met without requiring the explicit evaluation and testing of conditions as part of an imperative algorithm. Such elements are commonly referred as declarative, not theoretically related to declarative languages. We introduce declarative constructs in the C++ language, presenting the translation method to standard C++. The innovative feature of our method is the accommodation of l-values involving arbitrary pointer / array expressions and objects, supporting immediate runtime evaluation upon content update even if such l-values bind to variant storage locations at runtime. To accomplish this we define 'l-value redefinition graphs', capturing storage binding dependencies among variables, being the floor-plan of our code generation and runtime management approach.
翻译:我们注重控制结构,使程序员能够确定在满足各自条件而不需要作为必要算法的一部分对条件进行明确评价和测试的情况下所要采取的行动。这些要素通常被称为宣示性,在理论上与宣示性语言无关。我们用C++语言引入宣示性结构,将翻译方法引入标准C+++。我们方法的创新特征是容纳涉及任意指针/阵列表达式和对象的l值,支持在内容更新时立即进行运行时间评价,即使这类l值与运行时的变异储存地点有关。为了完成这一定义,我们定义了“l-value re定义图”,捕捉了变量之间的储存约束性依赖性,这是我们代码生成和运行时间管理方法的底部计划。