Download presentation
Presentation is loading. Please wait.
Published byScott Bailey Modified over 9 years ago
2
Parser-Driven Games Tool programming © Allan C. Milne Abertay University v12.7.11
3
Agenda. Motivation and Course Overview. Translator Process Overview. Applications. Some Terminology.
4
Motivation. Games are complicated compositions of many components and often a tool may assist either the development or implementation process. Tools may be useful in the areas of –management, assisting the project development process by providing support functions against the code base; –development, generating parts of the code base. –implementation, being an integral part of the code base.
5
Motivation Continued. The tools you develop will often be analysing, processing or be under the control of a program/script written in some language. Therefore the tool is in some sense “driven” by the structure of the program; this structure being elucidated by a parser; hence the term parser-driven tools.
6
The Aim Of This Course Is To Provide You With … … an overview of analysis and synthesis phases of the compilation process; … an appreciation of appropriate parser-based tools for use within computer games software development projects; … an introduction to the skills, terminology and techniques used to develop such tools.
7
The Development Environment. We will be using Flex and Bison; –These are versions of the Lex and Yacc language processing packages respectively. These will be working in the C language. We will be working in a command-line environment; –Programs > Visual Studio > Visual Studio Tools > Visual Studio Command Prompt
8
On Completion You Should Be Able To … … explain the terms and terminology used to describe the construction and operation of compilers … construct simple software translators … identify opportunities for parser based tools within a development project … specify and develop parser based tools
9
Translator Overview. A translator (or compiler) will process input text by treating it syntactically as a sentence from some language. It must also include semantic knowledge of the language in its processing. In processing the sentence a compiler must –Determine its syntactic structure, –check the semantic consistency, and –interpret or generate corresponding artifacts.
10
Translator Input. The primary input to a translator is the input text (source program). Formally this input text is a sentence from some language. The translator inputs the program as a stream of individual characters. Other user inputs may control the operation of the translator.
11
Translator Output. Intermediate or machine code. A program in some other language. An analytical report on the input text. A data structure representing the input. Direct actions. … or some other artifact.
12
Translator Processing Phases. Input text Lexical Analysis Syntax Analysis Semantic Analysis Synthesis Generated artifact
13
Component Interactions. character stream Lexical Analysis Syntax Analysis Semantic Analysis Synthesis Artifact (instruction stream) terminal tokens syntax tree symbol table
14
Error Handling. The translator must handle syntactic and semantic errors. Error detection: find invalid syntactic structures or misuse of semantics. Error reporting: report to the user the type, position and cause of the error. Error recovery: allow the translation process to continue after an error.
15
Application Areas. Management. –providing support functions against the code base; Development. –generating parts of the code base. Implementation. –being an integral part of the code base.
16
Examples of Management Tools. Reporting code metrics. Code transformations. Integration of different code components. Test data generation. Identifying and controlling versioning.
17
Examples of Development Tools. Particle generators. Generating graphics rendering pipelines. Managing audio resources. Generating graphics data files. Scripting generic game engines.
18
Examples of Implementation Tools. Processing user conversations. Dynamic scripting. Configuration and property management. Handling message protocols. Game state storage and retrieval.
19
Some Translator Terminology. Translator; –Transforms structured input text into some corresponding output artifact. Compiler; –Transforms an input source program into object code for a real or virtual machine. Interpreter; –Transforms input source program into directly executed actions.
20
Some Compiler Terminology. Source program = input text. Object code = 1 type of generated artifact. Scanner = lexical analyser = lexer. Parser = syntax analyser = recogniser.
21
The Language. The tools we are looking at all require some input text that is a sentence (program) in some language. This language has both a syntax (structure) and semantics (context- sensitive meaning). The syntax of the language defines the structure of all possible programs that can be written in that language.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.