Author Topic: VOCABASE.VC  (Read 14487 times)

0 Members and 1 Guest are viewing this topic.

Offline OmerMor

VOCABASE.VC
« on: June 20, 2016, 05:27:10 PM »


;  VOCABASE.TXT:  Basic word dictionary file
;  -----------------------------------------
;
;  for   Sierra On-line, 12/16/88
;        source file Vocabase.vc converted to new syntax 1/3/89
;
;  by    Pablo Ghenis, Parsemaster extraordinaire.
;
;
;  Special mention goes to Robert Fischbach for blazing the trail with the 
;  first sanely organized (!?) vocabulary file in Sierra On-line's history
;
;
;  Parts of speech recognized are:
;
;     ARTicle
;     CONJunction
;     PRONoun
;     ASSociative preposition
;     POSitional preposition
;     ADVerb
;     AUXVerb
;
;     ADJective
;     VERB
;     NOUN
;
;  Word numbers 1 to 999 are reserved for "system level" words, namely those
;  of the first seven classes above. Please do not modify this area, if a
;  word or part of speech is missing for any of these words let ME know and
;  I will add it ASAP; that way others may also benefit from the update.

;  Word numbers 4000 to 4095 are reserved for system hooks and kludges, If
;  you dare to use these your actors will forever stutter and your
;  lexical karma will never be the same.

;  This leaves word numbers 500 to 3999 for ADJectives, VERBS and NOUNS, which
;  is all you should HAVE to define for your game. My recommendation is to
;  allocate those numbers as follows:
;
;   500- 999   ADJectives
;  1000-1999   VERBs
;  2000-3999   NOUNs
;
;
;  Formatting suggestion if not already using the vocab preprocessor:
;  newlines are cheap, leave a blank line between distinct words,
;  cluster only synonyms


;***************************************************************************
;
;  DIRECTORY:
;
;     ART            1+
;     CONJ           50+
;     PRON           100+
;     ASS            150+
;     POS            200+
;     ADV            300+
;     AUXV           400+
;
;     system         4000+
;     end of world   4095
;
;  recommended for user file:
;
;     ADJ            500+
;     VERBS          1000+
;     NOUNS          2000+
;
;***************************************************************************
;***************************************************************************
;
;  ART(icles)
;  **********

(#art #NUMBER 1
   
   the
   a
   an
   
   ;some spanish articles for Leisure Suit Larry
   ;--------------------------------------------
   
   el
   la
   los
   
);#art

;***************************************************************************
;
;  CONJ(unctions)
;  **************

(#conj   #NUMBER 50
   
   and
   or
   nor
   ++    ;of
   if
   but
   
);#conj
;***************************************************************************
;
;  proNOUNs:   any of these will get translated to the root of the last
;  ********    previous sentence's direct object



(#pron   #NUMBER 100

   it   
   this 
   these
   that 
   those
   them 
   themselves
   him   
   himself
   her
   herself
   
);#pron

   ;;we really use the following pronouns as nouns sooo...
   
(#noun
   
   (#synonyms  I  me    myself)
   he   
   she   
   they 
   (#synonyms  you   ya)   
   yourself
   we   
   us   
   ourselves
   
);#noun

;***************************************************************************
;
;  ASS(ociative prepositions)
;  **************************

(#ass #NUMBER 150

   until
   while
   with
   without
   for
   about
   
);#ass

;***************************************************************************
;
;  POS(itional prepositions)
;  **************************

(#pos #NUMBER 200

   to       ;changed from #ass by Pablo 9/4/89
   from
   
   at
   (on upon)
   onto
   off
   (in   into  inside)
   (out  outer outside)
   (under   underneath  below beneath)
   between
   across
   (over above)
   through
   (#noun behind)
   ahead
   (#noun #verb   back)
   front
   around
   here
   there
   everywhere
   nowhere
   somewhere
   forward
   backward
   toward
   by
   near
   far
   
   of
   
);#pos

;***************************************************************************
;
;  ADV(erbs)
;  *********

(#adv #NUMBER 300

   how
   where
   when
   why
   what
   who
   soon
   sooner
   soonest
   now
   late
   later
   latest
   (#synonyms  fast  quickly  quick speedy)
   (#synonyms  slow  slowly   sluggishly)
   normal
   (#synonyms  abnormal strange)
   so
   again
   always
   never
   then
   up
   down
   together
   please
   away
   along
   overboard
   not
   almost
   (#synonyms  yes   y  ok affirmative (#noun roger)  sure certainly aye yep)
   (#synonyms  no n negative nay nope)
   (#synonyms  maybe dunno possibly probably)
   
);#adv

;***************************************************************************
;
;  AUXV(erbs)
;  **********

(#auxv   #NUMBER 400

   ;to do or not to do much ado about nothing...)
   do
   did
   (#noun   does)
   ;----------------------
   
   ;to be or not to be...
   be
   (is are youre wheres)
   (am Im)  ;Im=I'm
   ++             ; Removed "are" to make it a synonym for "is"
   was
   ;----------------------
   (#noun   can)
   (#noun   will)
   would
   go
   (stop cease)
   (start   begin)
   
   ;say what!??
   say
   says
   said
   ;----------------------
   
   ;let em have it
   have
   has
   had
   ;----------------------
   
   tell     ;tell man to break window     -> break<tell<man<to/window
   use      ;USE wire to CONNECT circuit  -> connect<use<wire<to/circuit
   
   (shout yell scream holler)
   
);#auxv


;***************************************************************************
;
;  System-level   hacks
;  ******************

;These numbers MUST be present to work around an obscure bug in findWord:
;

(#NUMBER 4000  #noun

   (#synonyms  0  zero  o)
   (#synonyms  1  one)
   (#synonyms  2  two)
   (#synonyms  3  three)
   (#synonyms  4  four)
   (#synonyms  5  five)
   (#synonyms  6  six)
   (#synonyms  7  seven)
   (#synonyms  8  eight)
   (#synonyms  9  nine)
   
   (#synonyms  10 ten)
   
   (#synonyms  11 eleven)
   (#synonyms  12 twelve)
   (#synonyms  13 thirteen)
   (#synonyms  14 forteen fourteen)
   (#synonyms  15 fifteen)
   (#synonyms  16 sixteen)
   (#synonyms  17 seventeen)
   (#synonyms  18 eighteen)
   (#synonyms  19 nineteen ninteen)
   
   (#synonyms  20 twenty)
   (#synonyms  30 thirty)
   (#synonyms  40 forty)
   (#synonyms  50 fifty)
   (#synonyms  60 sixty)
   (#synonyms  70 seventy)
   (#synonyms  80 eighty)
   (#synonyms  90 ninety)
   
   (#synonyms  100   hundred)
   (#synonyms  1000  thousand)
   (#synonyms  1000000  million)
   
   
);#NUMBER 4000

;Here come the hacks from the deep!

(#NUMBER 4093

   ;4093    Any number not explicitly in the vocabulary:
   ;        hard-coded into interpreter)
   ;
   (#noun unknownNumber)
   
   ;4094    Nothing a user would type could match this word:
   ;        hard-coded into interpreter)
   ;
   (#synonyms  !* NOWORD)
   
   ;4095    Anything will match this word:
   ;        hard-coded into interpreter)
   ;
   (#synonyms
      #noun #verb #adj  #pos  #conj #art  #adv  #auxv #pron
      *  ANY   ANYWORD
   )
)
;************************ END OF BASE VOCABULARY ***************************



Offline Kawa

Re: VOCABASE.VC
« Reply #1 on: June 20, 2016, 05:55:09 PM »
Hah! That's a bit more readable than what I reproduced back when the first docs came out :D

Offline gumby

Re: VOCABASE.VC
« Reply #2 on: June 20, 2016, 07:15:54 PM »
Nice read, thanks Omer.
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline troflip

Re: VOCABASE.VC
« Reply #3 on: June 20, 2016, 07:29:50 PM »
Quote
Word numbers 1 to 999 are reserved for "system level" words, namely those
;  of the first seven classes above. Please do not modify this area, if a
;  word or part of speech is missing for any of these words let ME know and
;  I will add it ASAP; that way others may also benefit from the update.

ruh-roh... SCI Companion just looks for the first empty slot and puts your new word there. Doesn't seem to have any ill effect though.

Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline Kawa

Re: VOCABASE.VC
« Reply #4 on: June 20, 2016, 07:32:28 PM »
Well, so long as you stay out of the 4000+ range...

Offline troflip

Re: VOCABASE.VC
« Reply #5 on: June 20, 2016, 07:47:26 PM »
I like the fact that #ass was a recognized token in their vocab parser.
Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline troflip

Re: VOCABASE.VC
« Reply #6 on: June 20, 2016, 07:58:30 PM »
Since we're talking about vocabs... Omer have you found anything about the purpose of the semanticFail method?

The game class has these:
- wordFail: an unrecognized word was used
- syntaxFail: the grammar isn't understood
- pragmaFail: the game had no response to the user's input
- semanticFail: ???

It doesn't look like semanticFail is used by any game code, or by the interpreter. I wonder if it was accidentally left in from some earlier iteration of SCI?
Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline Kawa

Re: VOCABASE.VC
« Reply #7 on: June 20, 2016, 08:16:37 PM »
I kinda feel like writing a vocab compiler.

At night.

no really it's 2:15 and I'm writing this in bed on my phone somebody please smother me.

Online Collector

Re: VOCABASE.VC
« Reply #8 on: June 20, 2016, 08:28:08 PM »
Omer, you titled this thread as VOCABASE.VC, but the content uses a TXT extension.  What is the actual extension of the file? What interpreter was this from?
KQII Remake Pic

Offline OmerMor

Re: VOCABASE.VC
« Reply #9 on: June 21, 2016, 03:32:51 AM »
It's VOCABASE.VC.
This is the input for the Vocabulary Compiler Preprocessor (VCPP.EXE), which outputs a VOCABASE.TXT file.
The file is from 1989-10-17 11:58.
It came with SCI version 0.000.571.

The resulting VOCABASE.TXT has the following header:
Code: [Select]
;;; DO NOT EDIT THIS FILE!!!!
;;;
;;; CREATED BY THE VCPP PRE-PROCESSOR
;;;
;;; instead, edit source file: vocabase.vc

The vocabase is used in conjunction with a game specific VOCAB.VC file, and together they comprise the game's vocabulary and grammar.

This is how it works:
REMAKE.BAT is used to (re)build the game:
Code: [Select]
if "%1" == "+b" goto backup
if "%2" == "+b" goto backup
if "%1" == "-b" goto nobackup
if "%2" == "-b" goto nobackup

rem default is
goto nobackup

:backup
call backsys

:nobackup

del classdef
copy selector.new selector

if "%1" == "-l" goto Log
if "%1" == "+l" goto Log
if "%1" == "l" goto Log

rem need files vocabase.vc deriv.txt grammar.txt nlsyms.txt
rem compile vocab.vc using vcomp to test vocabase.vc
rem
call vcpp vocabase.vc vocabase.txt
call vcpp vocab.vc vocab.txt
call dc
call gc
call sc -aO @remake.lst
goto Exit

:Log
echo *** make.log *** >remake.log
call vcpp  vocabase.vc vocabase.txt>>remake.log
call vcomp vocab.vc >>remake.log
call dc>>remake.log
call gc>>remake.log
call sc -asO @remake.lst>>remake.log

:Exit

As mentioned the following files are also needed:
DERIV.TXT:
Code: [Select]
; deriv.txt - English version
; *********
;
;this file contains the specifications for word transformations to be
;attempted when a word is not found in the dictionary. The notation is:
;
;(<input pattern> <parts of speech> <root pattern> <root parts of speech>)
;
;The idea is that if the result of applying a transform is an entry in the
;dictionary with the right word classification, then we have a match.
;
; -- Pablo Ghenis
;--------------------------------------------------------------------------

(*s      noun             *       noun )  ; books -> book
(*es     noun             *       noun )  ; boxes -> box
(*ies    noun             *y      noun )  ; fairies -> fairy
(*men    noun             *man    noun )  ; women -> woman
(*ves    noun             *fe     noun )  ; knives -> knife
(*ves    noun             *f      noun )  ; leaves -> leaf
(*people noun             *person noun )  ; chairpeople -> chairperson
   
(*ing    noun adj verb    *  verb )  ; playing -> play
(*ing    auxv             *  auxv )  ; doing -> do
(*ing    noun adj verb    *e verb )  ; living -> live
(*ing    auxv             *e auxv )  ; using -> use
(*nning  noun adj verb    *n verb )  ; running -> run
(*pping  noun adj verb    *p verb )  ; shopping -> shop
(*mming  noun adj verb    *m verb )  ; swimming -> swim
(*tting  noun adj verb    *t verb )  ; batting -> bat
(*rring  noun adj verb    *r verb )  ; sparring -> spar
(*gging  noun adj verb    *g verb )  ; digging -> dig
   
(*ed     adj noun         *  verb)  ; painted -> paint
(*ed     adj noun         *e verb)  ; closed -> close
(*nned   adj noun         *n verb)  ; conned -> con
(*pped   adj noun         *p verb)  ; shopped -> shop
(*mmed   adj noun         *m verb)  ; dimmed -> dim
(*tted   adj noun         *t verb)  ; batted -> bat
(*rred   adj noun         *r verb)  ; sparred -> spar
(*gged   adj noun         *g verb)  ; rigged -> rig
(*ied    adj noun         *y verb)  ; tried -> try
   
(*er     adj noun         *  adj verb)  ; painter -> paint
(*er     adj noun         *e adj verb)  ; closer -> close
(*nner   adj noun         *n adj verb)  ; thinner -> thin
(*pper   adj noun         *p adj verb)  ; shopper -> shop
(*mmer   adj noun         *m adj verb)  ; dimmer -> dim
(*tter   adj noun         *t adj verb)  ; fatter -> fat
(*rrer   adj noun         *r adj verb)  ;  -> 
(*gger   adj noun         *g adj verb)  ; bigger -> big
(*ier    adj noun         *y adj verb)  ; lowlier -> lowly
   
(*est    adj              *  adj )  ; slowest -> slow
(*est    adj              *e adj )  ; closest -> close
(*nnest  adj              *n adj )  ; thinnest -> thin
(*ppest  adj              *p adj )  ; hippest -> hip
(*mmest  adj              *m adj )  ; dimmest -> dim
(*ttest  adj              *t adj )  ; fattest -> fat
(*rrest  adj              *r adj )  ;  -> 
(*ggest  adj              *g adj )  ; biggest -> big
(*iest   adj              *y adj )  ; lowliest -> lowly
   
(*ly     adv              *  adj )  ; slowly -> slow
   
(*y      adj              * noun )  ; rocky -> rock
   
(*ish    adj              *  adj )  ; yellowish -> yellow

GRAMMAR.TXT:
Code: [Select]
INCLUDE nlsyms.txt

_DATA segment

org 0

;;;
;;; Mark as a VOCAB file
;;;

db 86h,0

;;;
;;; Here comes the Parser NL Grammar
;;;

dw NLS,     NLROOT,NLVP,    NULL,NULL,      NULL,NULL,       NULL,NULL,NULL

;;;
;;;******************* VP *******************
;;;

;shoot
dw NLVP,    NLROOT,NLCVERB, NULL  ,NULL,    NULL,NULL,       NULL,NULL,NULL

;put board down = put<down/board
dw NLVP,    NLROOT,NLCVERB, NLDOBJ,NLNP,    NLMOD,NLPREP,    NULL,NULL,NULL

;color the paper red
dw NLVP,    NLROOT,NLCVERB, NLDOBJ,NLNP,    NLMOD,NLCADJ,    NULL,NULL,NULL

;hit board lightly
dw NLVP,    NLROOT,NLCVERB, NLDOBJ,NLNP,    NLMOD,NLADV,     NULL,NULL,NULL

;talk to dwarf
;put down board = put<down/board
dw NLVP,    NLROOT,NLCVERB, NLDOBJ,NLNP,    NULL,NULL,       NULL,NULL,NULL

;give gold to dwarf =  'give<to/gold/dwarf'
;put rock under bridge = 'put<under/rock/bridge'
dw NLVP,    NLROOT,NLCVERB, NLDOBJ,NLNP,    NLMOD,NLPREP,  NLIOBJ,NLNP,NULL

;give dwarf the gold: IO=dwarf DO=gold (same as above) 'give/gold/dwarf'
dw NLVP,    NLROOT,NLCVERB, NLIOBJ,NLNP,    NLDOBJ,NLNP,     NULL,NULL,NULL

;talk to dwarf about gold: talk<to/dwarf/gold<about
dw NLVP,    NLROOT,NLCVERB, NLDOBJ,NLNP,    NLIOBJ,NLAP,     NULL,NULL,NULL

;talk about gold = 'talk//gold<about'
dw NLVP,    NLROOT,NLCVERB, NLIOBJ,NLAP,    NULL,NULL,       NULL,NULL,NULL

;burger = '/burger'
;john is SORRY
dw NLVP,    NLDOBJ,NLNP,    NULL  ,NULL,    NULL,NULL,       NULL,NULL,NULL

;burger with fries = '/burger/fries
dw NLVP,    NLDOBJ,NLNP,    NLIOBJ,NLAP,    NULL,NULL,       NULL,NULL,NULL

;*** this doesn't work, phrase MUST have a root or SCI bombs ***
; WITH FRIES or IN THE TRUNK
;dw NLVP,    NLIOBJ,NLAP,    NULL,NULL,      NULL,NULL,       NULL,NULL,NULL

;TELL THE MAN TO give the gold to the dwarf = 'give<TELL<MAN<TO/gold/dwarf'
dw NLVP,    NLMOD ,NLCVERB, NLMOD,NLNP,     NLMOD ,NLPREP,   NLROOT,NLVP,NULL

;the tall clerk is the killer: 'is<(clerk<tall)/killer'
;john is sorry = is<john/sorry
dw NLVP,    NLMOD,NLNP,     NLROOT,NLVP,    NULL,NULL,       NULL,NULL,NULL

;;;
;;;******************* NP *******************
;;;

;the book
dw NLNP,    NLIGNR,NLART,   NLROOT,NLCNOUN, NULL,NULL,       NULL,NULL,NULL

;the red book
dw NLNP,    NLIGNR,NLART,   NLMOD ,NLCADJ,  NLROOT,NLCNOUN,  NULL,NULL,NULL

;red book
dw NLNP,    NLMOD ,NLCADJ,  NLROOT,NLCNOUN, NULL,NULL,       NULL,NULL,NULL

;red
dw NLNP,    NLROOT,NLCADJ,  NULL,NULL,      NULL,NULL,       NULL,NULL,NULL

;book
dw NLNP,    NLROOT,NLCNOUN, NULL,NULL,      NULL,NULL,       NULL,NULL,NULL


;;;
;;;******************* AP *******************
;;;

;put rock UNDER BRIDGE - OBSOLETE CLAUSE
;dw NLAP,    NLMOD ,NLPREP,  NLROOT,NLNP,    NULL,NULL,       NULL,NULL,NULL

;give book TO DWARF
;chop tree WITH AX
dw NLAP,    NLMOD ,NLASS,   NLROOT,NLNP,    NULL,NULL,       NULL,NULL,NULL

;chop tree USING AX
dw NLAP,    NLMOD ,NLAUXV,  NLROOT,NLNP,    NULL,NULL,       NULL,NULL,NULL

;ask maid TO DO THE BED
dw NLAP,    NLMOD ,NLASS,   NLROOT,NLAUXV,  NLMOD ,NLNP,     NULL,NULL,NULL

;ask child TO BE QUIET
dw NLAP,    NLMOD ,NLASS,   NLROOT,NLAUXV,  NLMOD ,NLADJ,    NULL,NULL,NULL

;"sleep" in "do fairies sleep" spec: 'do/fairies/sleep'
dw NLAP,    NLROOT,NLCVERB, NULL  ,NULL,    NULL,NULL,       NULL,NULL,NULL

;say the body IS IN THE TRUNK
dw NLAP,    NLMOD,NLCVERB,  NLROOT,NLAP,    NULL,NULL,       NULL,NULL,NULL

;ask ABOUT SYMBOL OF MITHRA = ask//symbol<about<symbol<of
;("of" is a positional PREPosition)
dw NLAP,    NLMOD ,NLASS,   NLROOT,NLNP,    NLMOD,NLPREP,    NLMOD,NLNP,NULL

;???
;dw NLAP,    NLROOT,NLNP,    NULL  ,NULL,    NULL,NULL,       NULL,NULL,NULL
;dw NLAP,    NLROOT,NLVP,    NULL  ,NULL,    NULL,NULL,       NULL,NULL,NULL

;;;
;;;******************* CNOUN *******************
;;;

;bow and arrows
;door of the crypt
dw NLCNOUN, NLROOT,NLNOUN,  NLIGNR,NLCONJ,  NLROOT,NLNP,     NULL,NULL,NULL

;prison guard jacket
dw NLCNOUN, NLMOD ,NLNOUN,  NLROOT,NLCNOUN, NULL,NULL,       NULL,NULL,NULL

;jacket
dw NLCNOUN, NLROOT,NLNOUN,  NULL,NULL,      NULL,NULL,       NULL,NULL,NULL

;;;
;;;******************* CVERB *******************
;;;

;go swim
dw NLCVERB, NLMOD ,NLAUXV,  NLROOT,NLCVERB, NULL,NULL,       NULL,NULL,NULL

;did you see?
;do zombies sleep?
dw NLCVERB, NLMOD ,NLAUXV,  NLMOD ,NLNOUN,  NLROOT,NLCVERB,  NULL,NULL,NULL

;john IS sorry
dw NLCVERB, NLROOT,NLAUXV,  NULL,NULL,      NULL,NULL,       NULL,NULL,NULL

;go to swim
dw NLCVERB, NLMOD,NLAUXV,   NLMOD,NLPREP,   NLROOT,NLVERB,   NULL,NULL,NULL

;go down to swim
dw NLCVERB, NLMOD,NLAUXV,  NLMOD,NLPREP,  NLMOD,NLPREP,  NLROOT,NLVERB,NULL

;put
dw NLCVERB, NLROOT,NLVERB,  NULL,NULL,      NULL,NULL,       NULL,NULL,NULL

;put down
dw NLCVERB, NLROOT,NLVERB,  NLMOD ,NLPREP,  NULL,NULL,       NULL,NULL,NULL

;lie down on
dw NLCVERB, NLROOT,NLVERB,  NLMOD ,NLPREP,  NLMOD ,NLPREP,   NULL,NULL,NULL

;COLOR BRIGHT RED the paper
dw NLCVERB, NLROOT,NLVERB,  NLMOD ,NLCADJ,  NULL,NULL,       NULL,NULL,NULL

;swim quickly
dw NLCVERB, NLROOT,NLVERB,  NLMOD ,NLADV,   NULL,NULL,       NULL,NULL,NULL

;HOW MUCH IS dinner : 'is<much<how/dinner'
dw NLCVERB, NLMOD ,NLADV,   NLMOD ,NLADV,   NLROOT,NLCVERB,  NULL,NULL,NULL

;soundly sleep
;what did you see
dw NLCVERB, NLMOD ,NLADV,   NLROOT,NLCVERB, NULL,NULL,       NULL,NULL,NULL

;how
dw NLCVERB, NLROOT,NLADV,   NULL,NULL,      NULL,NULL,       NULL,NULL,NULL

;"what time is" in "what time is it" spec: 'is<what<time'
dw NLCVERB, NLMOD ,NLADV,   NLMOD ,NLNOUN,  NLROOT,NLCVERB,  NULL,NULL,NULL

;look and feel
dw NLCVERB, NLROOT,NLVERB,  NLIGNR,NLCONJ,  NLROOT,NLVERB,   NULL,NULL,NULL

;look, listen and feel
dw NLCVERB,  NLROOT,NLVERB,  NLROOT,NLVERB,  NLIGNR,NLCONJ,   NLROOT,NLVERB,NULL

;;;
;;;******************* CADJ *******************
;;;

;green
dw NLCADJ,  NLROOT,NLADJ,   NULL,NULL,      NULL,NULL,       NULL,NULL,NULL
;dark green
dw NLCADJ,  NLMOD ,NLADJ,   NLROOT,NLCADJ,  NULL,NULL,       NULL,NULL,NULL

;;;
;;;******************* VOCAB POINTERS *******************
;;;

dw NLADV,   NLVOCAB,ADV,    NULL,NULL,      NULL,NULL,       NULL,NULL,NULL
dw NLVERB,  NLVOCAB,VERB,   NULL,NULL,      NULL,NULL,       NULL,NULL,NULL
dw NLVERB,  NLVOCAB,AUXV,   NULL,NULL,      NULL,NULL,       NULL,NULL,NULL
dw NLAUXV,  NLVOCAB,AUXV,   NULL,NULL,      NULL,NULL,       NULL,NULL,NULL
dw NLNOUN,  NLVOCAB,NOUN,   NULL,NULL,      NULL,NULL,       NULL,NULL,NULL
dw NLPRON,  NLVOCAB,PRON,   NULL,NULL,      NULL,NULL,       NULL,NULL,NULL
dw NLADJ,   NLVOCAB,ADJ,    NULL,NULL,      NULL,NULL,       NULL,NULL,NULL
dw NLART,   NLVOCAB,ART,    NULL,NULL,      NULL,NULL,       NULL,NULL,NULL
dw NLPREP,  NLVOCAB,POS,    NULL,NULL,      NULL,NULL,       NULL,NULL,NULL
dw NLASS,   NLVOCAB,ASS,    NULL,NULL,      NULL,NULL,       NULL,NULL,NULL
dw NLCONJ,  NLVOCAB,CONJ,   NULL,NULL,      NULL,NULL,       NULL,NULL,NULL

dw NULL,    NULL,NULL,      NULL,NULL,      NULL,NULL,       NULL,NULL,NULL


_DATA ends
end

NLSYSMS.TXT
Code: [Select]
NULL     equ 0

;;;
;;; the following should be in sync
;;; NLSYMS.H
;;;
MINNLTOKEN equ 300
;NLRP    equ 301
;NLLP    equ 302
NLVERB  equ 303
NLNOUN  equ 304
NLART   equ 305
NLADJ   equ 306
NLPREP  equ 307
NLPRON  equ 308
NLCONJ  equ 309
NLAUXV  equ 310
NLADV   equ 311
NLASS   equ 312
NLCNOUN equ 313
NLCADJ  equ 314
NLCVERB equ 315
NLVP    equ 316
NLNP    equ 317
NLAP    equ 318
NLS     equ 319
NLEOL   equ 320
NLROOT  equ 321
NLDOBJ  equ 322
NLIOBJ  equ 323
NLMOD   equ 324
NLIGNR  equ 325
NLVOCAB equ 326
NLSPEC  equ 327
NLSPEC2 equ 328
NLPHR   equ 329
NLPHR2  equ 330
NLMORE  equ 331
NLUNIT  equ 332
NLPNCT  equ 333
NLEMPT  equ 334
NLOR    equ 335
NLOR2   equ 336
NLATOM  equ 337
NLOPT   equ 338
NLWORD  equ 339
NLPUT   equ 340
NLNUM   equ 341
EOGRAMMAR  equ 342
MAXNLTOKEN equ 343

;;;
;;; the following should be in sync
;;; VOCAB.H
;;;
VERB        equ 800h ;2048
ADV         equ 400h ;1024
AUXV        equ 200h ;0512
NOUN        equ 100h ;0256
PRON        equ 080h ;0128
ADJ         equ 040h ;0064
ART         equ 020h ;0032
POS         equ 010h ;0016
ASS         equ 008h ;0008
CONJ        equ 004h ;0004

ORSAID      equ 0f0h ;240
ANDSAID     equ 0f1h ;241
NEXTPART    equ 0f2h ;242
LEFTPAREN   equ 0f3h ;243
RIGHTPAREN  equ 0f4h ;244
OPTBEGIN    equ 0f5h ;245
OPTEND      equ 0f6h ;246
NUMBER      equ 0f7h ;247
MODIFIES    equ 0f8h ;248
RUNON       equ 0f9h ;249
METAEND     equ 0ffh ;255

;;;
;;; the following should be in sync
;;; NLSDGRMR.H
;;;
METASHIFT   equ 100h

NLRNON   equ RUNON * METASHIFT
NLLESS   equ MODIFIES * METASHIFT
NLSLSH   equ NEXTPART * METASHIFT
NLLP     equ LEFTPAREN * METASHIFT
NLRP     equ RIGHTPAREN * METASHIFT
NLLB     equ OPTBEGIN * METASHIFT
NLRB     equ OPTEND * METASHIFT
NLCOMA   equ ORSAID * METASHIFT
NLAND    equ ANDSAID * METASHIFT
NLEOSPEC equ METAEND * METASHIFT
NLEND    equ METAEND * METASHIFT

NLSGRMR.TXT:
Code: [Select]
INCLUDE nlsyms.txt

_DATA segment

org 0

;;;
;;; Mark as a VOCAB file
;;;

db 86h,0

;;;
;;; Here comes the Said-matcher Grammar
;;;

;;; ROOT CLAUSE MUST BE FIRST, OTHERS CAN FOLLOW IN ANY ORDER
;;;
dw NLS,    NLROOT,NLSPEC, NULL,NULL,      NULL,NULL,     NULL,NULL,     NULL

;;; PUT LOWEST-LEVEL CLAUSES FIRST TO SPEED UP SEARCH OVERALL
;;; makes the grammar read like a PASCAL program, upside-down
;;;
dw NLCOMA, NLPNCT,ORSAID,     NULL,NULL,  NULL,NULL,     NULL,NULL,     NULL
dw NLAND,  NLPNCT,ANDSAID,    NULL,NULL,  NULL,NULL,     NULL,NULL,     NULL
dw NLSLSH, NLPNCT,NEXTPART,   NULL,NULL,  NULL,NULL,     NULL,NULL,     NULL
dw NLLP,   NLPNCT,LEFTPAREN,  NULL,NULL,  NULL,NULL,     NULL,NULL,     NULL
dw NLRP,   NLPNCT,RIGHTPAREN, NULL,NULL,  NULL,NULL,     NULL,NULL,     NULL
dw NLLB,   NLPNCT,OPTBEGIN,   NULL,NULL,  NULL,NULL,     NULL,NULL,     NULL
dw NLRB,   NLPNCT,OPTEND,     NULL,NULL,  NULL,NULL,     NULL,NULL,     NULL
dw NLNUM,  NLPNCT,NUMBER,     NULL,NULL,  NULL,NULL,     NULL,NULL,     NULL
dw NLLESS, NLPNCT,MODIFIES,   NULL,NULL,  NULL,NULL,     NULL,NULL,     NULL
dw NLRNON, NLPNCT,RUNON,      NULL,NULL,  NULL,NULL,     NULL,NULL,     NULL
dw NLEND,  NLPNCT,METAEND,    NULL,NULL,  NULL,NULL,     NULL,NULL,     NULL

dw NLWORD, NLPUT,NULL,    NULL,NULL,      NULL,NULL,     NULL,NULL,     NULL

dw NLATOM, NLROOT,NLWORD, NULL,NULL,      NULL,NULL,     NULL,NULL,     NULL
dw NLATOM, NLIGNR,NLLB,   NLOPT,NLUNIT,   NLIGNR,NLRB,   NULL,NULL,     NULL
dw NLATOM, NLIGNR,NLLP,   NLROOT,NLUNIT,  NLIGNR,NLRP,   NULL,NULL,     NULL
dw NLATOM, NLROOT,NLNUM,  NULL,NULL,      NULL,NULL,     NULL,NULL,     NULL

dw NLOR,   NLROOT,NLATOM, NULL,NULL,      NULL,NULL,     NULL,NULL,     NULL
dw NLOR,   NLROOT,NLATOM, NLROOT,NLOR2,   NULL,NULL,     NULL,NULL,     NULL

dw NLOR2,  NLIGNR,NLCOMA, NLROOT,NLOR,    NULL,NULL,     NULL,NULL,     NULL

dw NLMOD,  NLIGNR,NLLESS, NLMOD,NLOR,     NULL,NULL,     NULL,NULL,     NULL
dw NLMOD,  NLIGNR,NLLB,   NLOPT,NLMOD,    NLIGNR,NLRB,   NULL,NULL,     NULL
dw NLMOD,  NULL,NULL,     NULL,NULL,      NULL,NULL,     NULL,NULL,     NULL

dw NLUNIT, NLROOT,NLOR,   NLROOT,NLMOD,   NULL,NULL,     NULL,NULL,     NULL
dw NLUNIT, NLROOT,NLOR,   NULL,NULL,      NULL,NULL,     NULL,NULL,     NULL
dw NLUNIT, NLROOT,NLMOD,  NULL,NULL,      NULL,NULL,     NULL,NULL,     NULL

;;; next superfluous clause may help performance
dw NLPHR2, NLIGNR,NLSLSH, NLROOT,NLWORD,  NULL,NULL,     NULL,NULL,     NULL
dw NLPHR2, NLIGNR,NLSLSH, NLROOT,NLUNIT,  NULL,NULL,     NULL,NULL,     NULL
dw NLPHR2, NLIGNR,NLSLSH, NULL,NULL,      NULL,NULL,     NULL,NULL,     NULL

;;; next superfluous clause may help performance
dw NLPHR,  NLROOT,NLWORD, NULL,NULL,      NULL,NULL,     NULL,NULL,     NULL
dw NLPHR,  NLROOT,NLUNIT, NULL,NULL,      NULL,NULL,     NULL,NULL,     NULL
   
dw NLDOBJ, NLDOBJ,NLPHR2, NULL,NULL,      NULL,NULL,     NULL,NULL,     NULL
dw NLDOBJ, NLIGNR,NLLB,   NLOPT,NLDOBJ,   NLIGNR,NLRB,   NULL,NULL,     NULL

dw NLSPEC2,NLROOT,NLPHR,  NLROOT,NLDOBJ,  NULL,NULL,     NULL,NULL,     NULL
dw NLSPEC2,NLROOT,NLPHR,  NULL,NULL,      NULL,NULL,     NULL,NULL,     NULL
dw NLSPEC2,NLROOT,NLDOBJ, NULL,NULL,      NULL,NULL,     NULL,NULL,     NULL

;;; next 2 superfluous clauses may help performance
dw NLMORE, NLMORE,NLRNON, NULL,NULL,      NULL,NULL,     NULL,NULL,     NULL
dw NLMORE, NULL,NULL,     NULL,NULL,      NULL,NULL,     NULL,NULL,     NULL

dw NLSPEC, NLROOT,NLSPEC2,NLROOT,NLMORE,  NULL,NULL,     NULL,NULL,     NULL

dw NLS,    NLROOT,NLSPEC, NULL,NULL,      NULL,NULL,     NULL,NULL,     NULL

dw NULL,   NULL,NULL,     NULL,NULL,      NULL,NULL,     NULL,NULL,     NULL


_DATA ends
end

GC.BAT:
Code: [Select]
echo off
echo GC: Grammar Compiler version 0.001
echo for use by authorized Sierra programmers only
echo requires MASM assembler
echo -
echo compiling Parser grammar grammar.txt to vocab.900...

masm -ml -s -t -z -w2 grammar.txt,grammar.o > gc.log;
link grammar.o; >> gc.log
exe2bin grammar vocab.900 >> gc.log
del grammar.o >> gc.log
del grammar.exe >> gc.log

echo done.
echo here is the log file gc.log:
more < gc.log

There's also VCOMPCFG.BAT:
Code: [Select]
rem this file if present should set environment variable vb to
rem point to the base vocab
set vb=system\vocabase.txt

REMAKE.LST is just a list of system classes:
Code: [Select]
system
timer

sound
intrface
usermenu

motion
reverse
chase
follow
wander

avoider
jump
actor
sort
count
sortcopy
user
file
save
invent
game
extra
gauge
orbit
path
sight
window
textra
mouser
rfeature
grooper
smooper
cat
demo
namefind
dcicon
dpath
reldpath
qscript
stopwalk
timedcue
qsound
loadmany
lastlink
forcount
track
gotosaid

Offline Kawa

Re: VOCABASE.VC
« Reply #10 on: June 21, 2016, 06:51:06 AM »
And so the black box becomes a little brighter.

Offline troflip

Re: VOCABASE.VC
« Reply #11 on: June 21, 2016, 11:50:15 AM »
Lots of good info in grammar.txt on what possibilities are available with said specs.

'give<TELL<MAN<TO/gold/dwarf'

Really, that works?
Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline MusicallyInspired

Re: VOCABASE.VC
« Reply #12 on: June 21, 2016, 06:37:24 PM »
Man....that parser, though.
Brass Lantern Prop Competition

Offline gumby

Re: VOCABASE.VC
« Reply #13 on: June 21, 2016, 07:50:45 PM »
I have found that it really does a pretty good job.  I will officially go on record now that I'll help anyone with any SCI0 parser-based game (from a parser perspective).  I got really, really far into a parser-based version of Zork in SCI, just hit the heap-wall  >:(

Oh yeah, and nice post Omer.  I enjoyed the read.
« Last Edit: June 21, 2016, 07:56:35 PM by gumby »
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Online Collector

Re: VOCABASE.VC
« Reply #14 on: June 21, 2016, 08:07:07 PM »
Gumby, did you ever look into the seasoned Pro Xmas e-card for its parser?
KQII Remake Pic


SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.058 seconds with 22 queries.