⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme

📁 This Source-Navigator, an IDE for C/C++/Fortran/Java/Tcl/PHP/Python and a host of other languages.
💻
字号:
This directory contains an example parser for Source-Navigator to parseassembly language programs.Because assembly language syntax differs so much depending on the target microprocessor and object file format, it is necessary to build an assembly parser customised to the assembly language being used.This directory contains two such syntax definitions: one for the ELF objectformat for Linux on an i486 processor and one for the ELF object format on SPARC Solaris.___________________________Building an assembly parserThis can be achieved by running "make TARGET=<target>" (ie. running"make TARGET=solaris-sparc".  One of the provided syntax definitions will bechosen and written to an M4 source file called `macros.m4'.macros.m4 is always the current working definition for the parser.  The GNUflex specification for the parser, abrowser.l.in, is preprocessed using the M4macro processor to produce a customised version of the flex specification(abrowser.l).  abrowser.l.in contains M4 macro invocations and those macrosare defined by macros.m4.__________________________Writing a syntax defintionThe assembly language parser needs the following information about theparticular assembly language syntax in order to parse source files:	- the end-of-line comment character.  In some assembly languages,	  this is a semicolon (`;') character.  In others, it is the	  `#' character.	- The set of opcode mneumonics for subroutine call instructions.	  In some instruction sets, this may be `call', but in others,          there may be more than one mneumonics such as `bra', `jsr', `jmp'.	  When there is more than one instruction in the "jump" class of           instructions, an M4 macro called `oneof' is provided to specify	  multiple mnemonics:		oneof(bra,jsr,jmp)        - The assembler's psuedo opcode for declaring a global data object          (with external linkage).  In the GNU assembler, `gas', this is often	  ".comm".		- The assembler's psuedo opcode for declaring a static data object	  without external linkage.  In `gas', this is often ".local".	- The assembler's pseudo opcode for defining a macro.  In `gas', this	  is often ".macro".	- The assembler's syntax for labels.  Most assemblers use the format	  "label:" with whitespace at the start of a line.  Other assemblers 	  such as `gas' for HP PA processors use just "label" but enforce           that it starts in column 1.	- The pattern used by a compiler when generating code in the	  particular assembly syntax.  This is only important when parsing	  code generated by a compiler instead of hand-written assembly	  source.Using one of the existing .m4 files, create a new syntax definition file bycopying it to a new name (e.g. coff-i386ex.m4) and customising it.  M4 macrodefinitions take the form:	define(`name', `replacement')For each macro in the synax definition file, edit the `replacement' text sothat the right information is placed into the flex specification once it isprocessed.Generate the parser by typing:	make TARGET=coff-i386ex_____________________Trying out the parserTo try out the parser, replace "SN=/usr/local/snavigator" in the Makefilewith the path to your Source-Navigator installation.A number of example assembly source files are provided.  They have beengenerated by a native GNU C compiler for the Intel 486 (ELF object fileformat).  Therefore you should only attempt to parse them using theappropriate version of the assembly parser.Build and test the parser by running `make test'.  The Source-Navigator projectdatabase will be created in the .snprj subdirectory.  You may then use thedatabase tools such as `dbdump' to inspect the project database.Because different operating systems have different library names for thedynamic loading library, you may need to change the "-ldl" library nameto the library which supports dynamic loading on your system. This is requiredto get rid of libtcl8.1 linker errors.Refer to the Source-Navigator Programmer's Reference Guide for details onwriting additional parsers for other programming languages.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -