首页 | 本学科首页   官方微博 | 高级检索  
相似文献
 共查询到20条相似文献,搜索用时 68 毫秒
1.
刘有耀  杨鹏程 《计算机应用》2016,36(9):2422-2426
针对当前大量遗产代码无法重复利用的问题,设计一种新的编译工具将C的串行代码转换为基于MPI+OpenMP的混合并行编程代码,降低了并行编程的开发成本。首先,通过对JavaCC的优化,实现一种可以解析C语言的词法和语法分析器,进行源代码分析并生成抽象语法树;其次,根据语法树对源代码进行控制依赖性和数据依赖性分析,产生可并行化的语句块分区;再次,按照提出的并行代码生成方法得到目标代码;最后,基于Visual Studio 2010构建目标代码仿真验证环境。实验结果表明,该工具可以较为理想地实现串行代码自动并行化,与手工编写的代码在加速比上的误差为8.2%~18.4%。  相似文献   

2.
采用扩展的巴科斯范式(EBNF)定义SQL语言的语法规则,提出了一种基于分析器自动生成工具(JavaCC)的SQL语言编译器的设计模型。该模型采用Java语言开发,具有良好的平台无关性;分别从词法、语法和语义分析、信息提取等方面进行编译器的设计与实现。实际运行结果表明:该模型能够快速高效地构建SQL编译器,且具有良好的可扩展性。  相似文献   

3.
Thomas R. Kramer 《Software》2010,40(5):387-404
A method is described for repairing some shift/reduce conflicts caused by limited lookahead in LALR(1) parsers such as those built by bison. Also, six types of Extended BNF (EBNF) construct are identified that cause a shift/reduce conflict when a Yet Another Compiler Compiler (YACC) file translated directly from EBNF is processed by bison. For each type, a replacement EBNF construct is described representing the same grammar and causing no shift/reduce conflict when its YACC equivalent is processed by bison. Algorithms are given for identifying instances of each type and transforming them into their replacements. The algorithms are implemented in an automatic parser builder that builds parsers for subsets of the DMIS language. The parser builder reads an EBNF file and writes C++ classes, a YACC file, and a Lex file, which are then processed to build a parser. The parsers build a parse tree using the C++ classes. The EBNF for DMIS is written in natural terms so that natural C++ classes are generated. However, if translated directly into YACC, the natural EBNF leads to 22 shift/reduce conflicts that fall into the six types. The parser builder recognizes the six constructs and replaces them automatically before generating YACC. The YACC that is generated parses in terms of unnatural constructs while building a parse tree using natural C++ classes. The six types of construct may occur in any statement‐based language that uses a minor separator, such as a comma; hence knowing how to recognize and replace them may be broadly useful. Published in 2010 by John Wiley & Sons, Ltd.  相似文献   

4.
介绍了XML解析的详细过程,设计并实现了一个特定Schema的XML解析器的自动生成工具。该生成工具以一个XML Schema文件作为输入,输出一个JavaCC词法和语法规格说明文件,然后在JavaCC工具的帮助下,生成一个基于特定XML Schema的XML解析器。实验证明,这个生成解析器能够对XML文档进行解析的同时,验证其有效性。  相似文献   

5.
We describe a method for generating queries for retrieving data from distributed heterogeneous semistructured documents, and its implementation in the metadata interface DDXMI (distributed document XML metadata interchange). The proposed system generates local queries appropriate to local schemas from a user query over the global schema. The system constructs mappings between global schema and local schemas (extracted from local documents if not given), path substitution, and node identification for resolving the heterogeneity among nodes with the same label that often exist in semistructured data. The system uses Quilt as its XML query language. An experiment is reported over three local semistructured documents: ‘thesis’, ‘reports’, and ‘journal’ documents with ‘article’ global schema. The prototype was developed under Windows system with Java and JavaCC.  相似文献   

6.
There have been several research works that analyze and optimize programs using temporal logic. However, no evaluation of optimization time or execution time of these implementations has been done for any real programming language. In this paper, we present a system that generates a Java optimizer from specifications in temporal logic. The specification is simpler, and the generated optimizers run more efficiently than previously reported work. We implemented a new model checker for a bidirectional CTL (computational tree logic) called CTLbd, which is equivalent to CTL-FV [Lacey, D., Jones, N.D., Van Wyk, E. and Frederiksen, C.C.: Compiler optimization correctness by temporal logic. Higher-Order and Symbolic Computation, Vol. 17, No. 3, pp. 173–206, 2004] after removing free variables. The model checker can check future and past temporal CTL operators symmetrically without any conversion. We also present a new specification language based on the bidirectional CTL that can express typical optimization rules very naturally. By adding rewriting conditions to allow for temporary variables and considering real-world language features such as exceptions, the system can perform optimization of Java programs. So far, a compiler optimizer using temporal logic was assumed to be impractical, because it consumes too much time. However, with our method, the generated Java compiler optimizer can compile seven of the SPECjvm98 benchmarks with a compile time from 4 seconds to 4 minutes.  相似文献   

7.
Lexical states in JavaCC provide a powerful mechanism to scan regular expressions in a context sensitive manner. But lexical states also make it hard to reason about the correctness of the grammar. We first categorize the related correctness issues into two classes: errors and warnings. We then extend the traditional context sensitive and a context insensitive analysis to identify errors and warnings in context‐free grammars. We have implemented these analyses as a standalone tool (LSA ), the first of its kind, to identify errors and warnings in JavaCC grammars. The LSA tool outputs a graph that depicts the grammar and the error transitions. Importantly, it can also generate counter example strings that can be used to establish the errors. We have used LSA to analyze a host of open‐source JavaCC grammar files to good effect. Copyright © 2015 John Wiley & Sons, Ltd.  相似文献   

8.
9.
Model checking JAVA programs using JAVA PathFinder   总被引:5,自引:0,他引:5  
This paper describes a translator called Java PathFinder (Jpf), which translates from Java to Promela, the modeling language of the Spin model checker. Jpf translates a given Java program into a Promela model, which then can be model checked using Spin. The Java program may contain assertions, which are translated into similar assertions in the Promela model. The Spin model checker will then look for deadlocks and violations of any stated assertions. Jpf generates a Promela model with the same state space characteristics as the Java program. Hence, the Java program must have a finite and tractable state space. This work should be seen in a broader attempt to make formal methods applicable within NASA’s areas such as space, aviation, and robotics. The work is a continuation of an effort to formally analyze, using Spin, a multi-threaded operating system for the Deep-Space 1 space craft, and of previous work in applying existing model checkers and theorem provers to real applications.  相似文献   

10.
付剑晶 《计算机工程》2010,36(11):164-166,169
代码反编译和逆向工程使软件安全受到严重威胁。针对该问题,根据Java编译器(JAVAC)与Java虚拟机(JVM)的语法特征差异,提出一种基于JAVAC与JVM特征的代码保护方案。给出修改标识符名和中断赋值2种混淆技术,加大程序的复杂度,降低程序的可读性,阻止反编译和逆向工程的自动进行。安全性与性能分析结果表明,该方案可行、有效。  相似文献   

11.
TestEra: Specification-Based Testing of Java Programs Using SAT   总被引:3,自引:0,他引:3  
TestEra is a framework for automated specification-based testing of Java programs. TestEra requires as input a Java method (in sourcecode or bytecode), a formal specification of the pre- and post-conditions of that method, and a bound that limits the size of the test cases to be generated. Using the method's pre-condition, TestEra automatically generates all nonisomorphic test inputs up to the given bound. It executes the method on each test input, and uses the method postcondition as an oracle to check the correctness of each output. Specifications are first-order logic formulae. As an enabling technology, TestEra uses the Alloy toolset, which provides an automatic SAT-based tool for analyzing first-order logic formulae. We have used TestEra to check several Java programs including an architecture for dynamic networks, the Alloy-alpha analyzer, a fault-tree analyzer, and methods from the Java Collection Framework.  相似文献   

12.
Since version 1.5, generics (parametric polymorphism) are part of the Java language. However, the combination of parametric polymorphism and inclusion polymorphism is complicated, particularly so for Generic Java. Indeed, the main Java compilers, Eclipse??s ejc and Sun??s javac, do not even accept the same set of programs. Moreover, experience with these compilers shows that the error messages provided by them leave more than a little to be desired. To alleviate the latter problem, we describe how to adapt the type inference process of Java to obtain better error diagnostics for generic method invocations. Although the extension by itself already helps to improve type error messages to some extent, another major advantage of the new type inference process is that it also paves the way for further heuristics can provide additional diagnostic information. The extension has been implemented into the JastAdd Extensible Java Compiler.  相似文献   

13.
禹丹  严宏志  王继娜 《计算机应用》2008,28(2):522-524,
采用了扩展的巴科斯范式(EBNF)定义NC程序语法规则,提出了一种基于语言识别工具(ANTLR)的NC代码编译器的设计模型。该模型采用Java语言开发,具有良好的平台无关性;分别从词法分析、语法和语义分析、信息提取等方面进行编译器的设计与实现。实际运行结果表明:该模型能够高效地构建编译器原型;可快速、准确地对NC代码进行编译;具有良好的可扩展性。  相似文献   

14.
In recent years, the popularity of the Internet has increased and Java has emerged as a powerful animation tool for creating web pages. However, users have still not exploited the full power of Java. Java is an object-oriented programming language with a rich set of application programming interfaces (API). It has the infrastructure for building applications in diverse domains with ease. Java's sophisticated networking APIs facilitate building network centric enterprise applications. Java's virtual machine enables development of architecture neutral applications which can be ported without any modifications. This has revolutionized the way software is written and distributed. This paper highlights the key features of Java language, illustrates the use of networking libraries and enlists features that facilitate enterprise software development.  相似文献   

15.
同步开销是影响并行程序性能的一个重要方面,如果同步操作出现在循环中,将会使这种影响进一步扩大.为了降低循环中同步操作的开销,本文提出一种利用即时编译器外提Java程序中循环内同步操作的优化算法,并在实际的Java虚拟机中实现.该算法在保证程序语义不变的前提下,大量减少运行时实际执行的同步操作数量,降低同步开销,并能保证外提变换后同步代码块不会太大而降低程序的并发度.实验结果表明该算法能提高程序的整体性能,并且不降低程序的可扩放性.  相似文献   

16.
The goal of autonomic computing is to reduce the configuration, operational, and maintenance costs of distributed applications by enabling them to self-manage, self-heal, and self-optimize. This paper provides two contributions to the Model-Driven Engineering (MDE) of autonomic computing systems using Enterprise Java Beans (EJBs). First, we describe the structure and functionality of an MDE tool that visually captures the design of EJB applications, their quality of service (QoS) requirements, and the adaptations applied to their EJBs. Second, the paper describes how MDE tools can be used to generate code to simulate adaptive systems for verification and plug EJBs into a Java component framework that provides runtime adaptation capabilities.  相似文献   

17.
This paper introduces one method for source code static semantic analysis at compilation time directly within standard compilers. The method is implemented via unified integration with Java compilers to get full access to Abstract Syntax Tree (AST) of compiled files after semantic analysis stage of compilation process. The unified integration is implemented by common AST interfaces and adapters to AST implementations of Sun/Oracle javac and Eclipse Compiler for Java (ecj) compilers. This method provides transparent integration with Eclipse and Netbeans integrated developer environments without a need for any special plugins. Several examples of program verification rules are presented to demonstrate the method.  相似文献   

18.
19.
This paper presents an interactive Java software platform which enables users to easily create advanced robotic applications together with Computer Vision processing. This novel tool is composed of two layers: (1) Easy Java Simulations (EJS), an open-source tool which provides support for creating applications with a full 2D/3D interactive graphical interface, and (2) EjsRL, a high-level Java library specifically designed for EJS which provides a complete functional framework for modeling and simulation of arbitrary serial-link manipulators, Computer Vision algorithms and remote operation. The combination of both components sets up a software architecture which contains a high number of functionalities in the same platform to develop complex simulations in Robotics and Computer Vision fields. In addition, the paper shows its successful application to virtual and remote laboratories, web-based resources that enhance the accessibility of experimental setups for education and research.  相似文献   

20.
由于Java Web应用业务场景复杂,且对输入数据的结构有效性要求较高,现有的测试方法和工具在测试Java Web时存在测试用例的有效率较低的问题.为了解决上述问题,本文提出了基于解析树的Java Web应用灰盒模糊测试方法.首先为Java Web应用程序的输入数据包进行语法建模创建解析树,区分分隔符和数据块,并为解析树中每一个叶子结点挂接一个种子池,隔离测试用例的单个数据块,通过数据包拼接生成符合Java Web应用业务格式的输入,从而提高测试用例的有效率;为了保留高质量的数据块,在测试期间根据测试程序的执行反馈信息,为每个数据块种子单独赋予权值;为了突破深度路径,会在相应种子池中基于条件概率学习提取数据块种子特征.本文实现了基于解析树的Java Web应用灰盒模糊测试系统PTreeFuzz,测试结果表明,该系统相较于现有工具取得了更好的测试准确率.  相似文献   

设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号