Betascript Publishing CRiSP File Editor 6 Manual do Utilizador Página 1

Consulte online ou descarregue Manual do Utilizador para Software Betascript Publishing CRiSP File Editor 6. Betascript Publishing CRiSP File Editor 6 User's Manual Manual do Utilizador

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 92
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 0
Page 1
CRiSP File Editor
Programmers Guide
Version 6
© 1998 Foxtrot Systems Ltd
www.pacemaker.co.uk
Vista de página 0
1 2 3 4 5 6 ... 91 92

Resumo do Conteúdo

Página 1 - Programmers Guide

Page 1CRiSP File EditorProgrammers GuideVersion 6© 1998 Foxtrot Systems [email protected]@crisp.demon.co.uk

Página 2

Page 10the usability features of CRiSP but also contain useful real-life examples of various aspects of CRiSPmacro programming.3. Where possibly, try

Página 3

Page 11crtags [switches] file1 file2 ...You can use Unix style wild cards for the filenames, even on the Windows platforms.The command line switches

Página 4

Page 12included on the command line. This allows you to generate a list of files and store them ina file rather than being exposed to the command line

Página 5

Page 13These switches allow you to specify the output file format.-tags Output is compatible with the Unix ctags program and hence the tags database c

Página 6

Page 14SQL .sqlTeX .texPerl .pl, .pmVerilog .v, .verilogVHD .vhd, .vhdlYacc grammars .yNote that crtags uses a fuzzy-parsingfuzzy parsing mechanism to

Página 7 - Disclaimer

Page 15ready for loading into CRiSP. The crunch program uses its own internal preprocessor which is very ANSI-Clike. By doing this gives the user more

Página 8

Page 16int(pg.21).32-bit signed integer.float(pg.21).64-bit floating point value.string(pg. 21).Variable length string.list(pg.22).Arbitrary collectio

Página 9 - Writing your own macros

Page 17{button See Also, ALink(crunch,,,)} ScopingAll variables created have a scope of visibility. CRiSP supports a number of scopes of visibility:

Página 10 - <Alt-F10>

Page 18not found, CRiSP then searches the current block level - 1. At this block level, the definitions are found.When a variable is accessed, CRiSP n

Página 11 - General switches

Page 19int sum(){ int arg_no = 0; int sum = 0; int arg; while (get_parm(arg_no, sum) > 0) sum

Página 12 - Filename filtering

Page 2Introduction 7777Disclaimer 7777Getting started with Macro programming 7777An Overview of the Programming Facilities 8888Writing your own macros

Página 13 - Languages

Page 20 Variable argument listsCRiSP supports a variety of mechanisms which allow for variable numbers of arguments to be passed tomacros. As descri

Página 14 - The crunch compiler

Page 21{d = max(a, b, c);}Note the ampersand after the type specifier for the last parameter in the list. Variables which are passed byreference are n

Página 15 - Data types

Page 22string length. string:definitionStorage for strings is dynamically allocated so no space needs to be preallocated for them.Strings may be combi

Página 16

Page 23The following sections describe various aspects of list management in more detail:List assignment(pg. 23).Making lists(pg. 23).Manipulating lis

Página 17 - Scoping

Page 24The make_list primitive is similar to quote_list() but each argument is evaluated in turn. For example:list qlst. mlst;qlst = quote_list(1, qls

Página 18 - Argument Passing

Page 25PrimitiveDescriptionbookmark_listList of bookmarks (placeholders).command_listList of primitives built into CRiSP.dict_listList of all symbols

Página 19

Page 26→ Function definitions(pg. 27).→ Expressions(pg. 27).→ Loop constructs(pg. 28).→ Conditional test - if(pg. 29).→ Selection: switch(pg. 29).{but

Página 20 - Variable argument lists

Page 27list l = { "Item-1", {1, 2, 3}, "Item-2", "hello mum","Item-3", 3.14159, /* Trailing c

Página 21 - The string datatype

Page 28binary | l -> rbinary && l -> rbinary

Página 22 - The list (array) datatype

Page 29The init-expr is evaluated first. Next the while-expr is evaluated, and if it evaluates to TRUE, then statementis executed. After statement is

Página 23 - Making Lists

Page 3List assignment 23Making Lists 23Manipulating List Items 24Sorting Lists 24Searching Lists 24Informational Lists 24The declare datatype 25Struct

Página 24 - Informational Lists

Page 30 case 1: case 2: do_something(); break; case 3: case 4: do_som

Página 25 - Language Grammar

Page 31messages on <stdout>. This function is only really useful if you are using a GUI version ofCRiSP, since otherwise the printf() output wil

Página 26 - Declarations

Page 32:/home/fox/bin:/usr/openwin/bin:/usr/openwin/demo:/usr/local/crisp/bin.sun4:/develop/sun4/bin:/develop/scripts:/develop/scripts:/develop/script

Página 27 - Expressions

Page 33switch is at the end of the command Debug bufferingOutput written to the crisp.log file is normally performed using buffered I/O. Sometimes it

Página 28

Page 34files which many other editors or standard utilities cannot cope with. Buffer AttributesEach buffer has a number of attributes or modes associa

Página 29 - Selection: switch

Page 35these files, CRiSP breaks up binary files into lines containing only 32 characters. To avoid problems if thefile is modified and written away,

Página 30 - Debugging macros

Page 36frequently annoying problem with vi(1)). The user can clear the read-only bit for a buffer by calling themake_writable macro (available from th

Página 31 - Macro tracing

Page 37All undo information is undoable itself. This is termed redo. Character MapsA character map is a way of viewing data through a window. Characte

Página 32 - Debug on startup

Page 38associated with it. When they are displayed in a window the character map associated with the window isused to view the buffer. (Windows always

Página 33 - Buffers, Files and Windows

Page 39timer(pg.45).CriSP supports callbacks based on an elapsed real-time clock.window(pg.33).A window is a character mode window with a view on to a

Página 34 - The Binary Flag

Page 4Current cursor position 35Modified Flag 35Permissions & Read-only Flag 35Process Buffers 36Region Markers 36Symbol Table 36System Buffers 36

Página 35

Page 40Autosaving is a feature enabled by default, whereby any modified files (buffers) within the current editingsession are saved at 60 second inter

Página 36

Page 41KeyDescription<Alt-L> Drops a line marker. When a cut or copy command is issued, whole lines will beaffected in the operation.<Alt-C&g

Página 37 - Character Maps

Page 42Static macros are very useful, as they are in the C language, to hide private macros in a large macro so thatname conflicts do not occur either

Página 38 - Objects supported by CRiSP

Page 43An arbitrary number of macros may be registered for the same event. If more than one macro is registeredfor the same event, then the macros are

Página 39 - Autosaving

Page 44new file.17 (REG_FILE_MOD) This is the modified file trigger. It is called when Crisp detects thatthe corresponding file on disk for a buffer h

Página 40 - Regions and markers

Page 45undoing back to the point where the buffer no longer needs saving. You should call theinq_modified() primitive to determine which of the two st

Página 41 - Global and Static macros

Page 46Note that this timer mechanism is independent of the idle timer mechanism described elsewhere. The idletimer mechanism is specifically designed

Página 42 - Registered Macros

Page 4715COL_BG_STRINGSBackground color for string literals.16COL_FG_KEYWORDSForeground color for language keywords.17COL_BG_KEYWORDSBackground color

Página 43

Page 48<, %, ^ matches the beginning of a line.>, $ matches the end of a line.? matches any single character.* matches zero or more characters[.

Página 44

Page 49For example, the following expression:cat*dogmatches any line which contains the word cat followed by somewhere else on the line, the word dog.

Página 45 - Timer functions

Page 5GUI Based Objects 55551111Terminology 52Windowing Systems Programming 52Overview of the Dialog box system 53Overview of an Object 54Creating a D

Página 46 - Color Support

Page 50[A-Za-z]]+ matches the final word in a sentence. The '.' matches the full-stop after it. The expression [ ]@matches zero or more spac

Página 47

Page 51backward matching.The search macros - search_fwd, search_back, translate, search_string and search_list have a parameter,labelled 're&apos

Página 48 - Character Escaping

Page 52functionality because this can help to increase performance whilst keeping the macro interface fairly simple.One of the design goals of the mac

Página 49 - Repetition: @ and +

Page 53years, such organisations as Microsoft, IBM, and the OSF have strived to achieve the ultimate userinterface. None of these organisations has pr

Página 50 - Minimal and Maximal Matching

Page 54creating a dialog box.1. Firstly, we sketch or conjure up a mental model of what the dialog box is going to look like. E.g. weconsider the user

Página 51 - GUI Based Objects

Page 55it. At various times you need to refer to the individual objects within the dialog box, e.g. so that you canretrieve the current status of the

Página 52 - Terminology

Page 56 ...object-2 attributes for object-2 ... ...object-n attributes for object-n ...You will notice i

Página 53

Page 57oriented implementation.DBOX_DIRECTORY An list type object which contains semantics forimplementing a selection from a set of valid files ordir

Página 54 - Overview of an Object

Page 58DBOX_PANED_WINDOW A container object used to contain two child objects.The real-estate allocated to the children can bechanged by using a slide

Página 55 - Creating a Dialog Box

Page 59DBOX_TREE A tree-like widget which supports outlining views ofdata. A tree widget is a bit like a DBOX_LISTwidget but you can control the visib

Página 56 - Object Types

Page 6Case study #2: Fortran colorizer 78Interprocess Communication and CRiSP 77779999IPC Mechanisms 79IPC Primitives 80IPC Callbacks 80TCP/UDP Commun

Página 57

Page 60 DBOX_CENTERED, DBOX_BUTTON, " Apply ", DBOX_NEXT_COLUMN, TRUE, DBOX_CENTERED,

Página 58

Page 61When laying out a dialog box, CRiSP tries hard to avoid objects from overlapping, so it is normally safe touse the DBOX_ANCHOR attributes even

Página 59 - Geometry Layout

Page 62 /* The first object is an input field, */ /* and we have a label to the left of the */ /* input field. */ DBOX_FIE

Página 60

Page 63as children of a DBOX_TOOL_BAR.For the DBOX_MENU_BAR case, only DBOX_MENU_BUTTON or DBOX_DROP_SITE types arereasonable children. For DBOX_TOOL_

Página 61

Page 64dialog box.There is a solution to this, and it is called object-grouping. Object-grouping is a mechanism where youcreate a collection of object

Página 62

Page 65group is very similar to a normal group, but was designed to solve a different problem, and first came to lifewith the implementation of the DB

Página 63

Page 66every time you click that button, the number is incremented. Where do you store the current value of thelabel? (You can use the label itself, b

Página 64 - Sub-groups

Page 67CRiSP takes a Microsoft Windows style approach. CRiSP is an interpreter and the macro language can bestbe considered as a very powerful languag

Página 65 - Properties (private symbols)

Page 68This is a piece of CRiSP macro code. The CRiSP macro code looks and feels a lot like C. Withoutnecessarily knowing any of the details of the ma

Página 66 - Dialog boxes and Callbacks

Page 69definition is needed to tell CRiSP how to perform colorization of keywords for files of a particular type.CRiSP comes with a variety of support

Página 67 - Platform Specific Issues

Page 7. IntroductionDocument version: 1.002, date 24 November 1997This guide discusses how to write macros in the CRiSP extension language, known as

Página 68 - Keyword Builder

Page 70New Clears the dialog in preparation for typing in a new definition. You are prompted to saveany changes before the dialog box is cleared out.S

Página 69 - Dialog box buttons

Page 71colorizers available, based on the filename not the section name. The flags= DirectiveColorization:flags directiveThe flags= entry in a keywor

Página 70 - .KWD Keyword File Format

Page 72spell_textFor most languages, you would not spell check all the types of entities in your files. You wouldnormally restrict spell checking to t

Página 71 - The flags= Directive

Page 73Defines the characters which can form the 2nd and subsequent characters in a keyword or variablename. This may be different from the char_start

Página 72 - Character Class Directives

Page 74char_backslash=This class is used to redefined the backslash character. In many languages, backslash character isused to turn off (or escape) t

Página 73

Page 75→ More than one keyword can be specified on each line; each keyword is enclosed in double quotes.Backslashes are used inside the quotes to esca

Página 74 - Keyword Directives

Page 76 Keyword Regular ExpressionsColorization:keyword regular expressionsKeyword regular expressions are away of allowing generic styles of strings

Página 75 - Keyword Flags

Page 77inside the string, or any other non-printable character, you can use a backslash to affect the followingcharacters.In many languages, string co

Página 76 - Colorization:limitations

Page 78operator= "+=" "-=" "*=" "/=" "|=" "&=" "^=" "==" "!=&

Página 77 - Case study #1: C colorizer

Page 79keyword="union"keyword="while" "write" Interprocess Communication and CRiSPInterprocess communication is the mea

Página 78

Page 8# include <crisp.h>voidmymacro(){message("This is my macro!");}The #include statement is something you will need sooner or later

Página 79 - IPC Mechanisms

Page 80support these pipes. Windows/32 named pipes are more like TCP connection which allowtwo tasks on different machines to communicate.PTYs(pg. 84)

Página 80 - IPC Callbacks

Page 81The key to writing non-blocking macros is to write them based on callbacks, using the ipc_register() function.There are four conditions for whi

Página 81

Page 82Client Side Programming IssuesWhen using TCP to connect to a remote site, there may be some considerable delay in the connection beingaccepted,

Página 82 - IPC_TRIGGER_WRITE

Page 83/* We have either successfully or unsuccessfully *//* connected to the remote host. *//* We can tell the difference by whether the ipc_write */

Página 83

Page 84 Pipe CommunicationsThere are two forms of pipes which can be used: anonymous pipes and named pipes. Both types are verysimilarly - the differ

Página 84 - PTYPseudo

Page 85zero bytes, then the other end of the pipe has most likely terminated. Alternatively you may use theipc_register() callback to register notific

Página 85 - DDEProgram Manager

Page 86Client Side operationTo make a client request, you need to create an IPC channel and specify the name of the service and topicyou wish to conne

Página 86 - Signals Communications

Page 87mechanism.SignalsSIGUSR1SIGUSR2register_macroREG_SIGNALasync.crSignal based communicationThe SIGUSR1 and SIGUSR2 IPC mechanism is probably the

Página 87 - Keyboard objects

Page 88keyboard. When you press a key, CRiSP looks at the current buffer and looks to see if a local keyboard hasbeen defined for this buffer. If so,

Página 88 - Character based terminals

Page 89Scan CodesAs described above, CRiSP uses a set of key definitions which allow you to create macros which are notdependent on the keyboard and s

Página 89 - Scan Codes

Page 9→Writing your own macros(pg. 9).→The .m language(pg. 90).→The crunch language(pg. 14). Writing your own macrosPrivate macros can be loosely cat

Página 90 - The cm compiler

Page 90This populates the current keyboard with all the normal typeable characters (A..Z, a..z, 0..9, etc) sothat they are self-inserting (see self_in

Página 91

Page 91files are compiled directly into loadable files with a .cm extension).CRiSP can load .m files directly without any need for compilation, but th

Página 92

Page 92

Comentários a estes Manuais

Sem comentários