Action Grammar (yacc-style)

AUTHOR: Dr. Gerd Döben-Henisch
FIRST DATE: December 28, 1995
DATE of LAST CHANGE: December 28, 1995



%{
%}


%union {
long int longint;
unsigned long int ulongint;
char string[500];
};


%token LB
%token RB
%token POS
%token HEADING
%token ENERGY
%token ACTION
%token AT
%token ACT
%token FROM
%token TURNBODY
%token GO
%token VELOCITY
%token DIR
%token ENERGY
%token TAKE
%token PUT
%token MOVE
%token WITH
%token ENDPOINT
%token LAYER
%token HEADING
%token STATE
%token SAY
%token VOICEDATA
%token AT
%token IN
%token EAT
%token DRINK
%token SLEEP
%token AWAKE
%token PAIRING
%token LOGOUT


%token INTERN
%token WEIGHT
%token SMELL
%token SMELL_INTENSITY
%token TASTE
%token NOISE
%token NOISE_INTENSITY
%token ENERGY
%token THIRST
%token AGGRESSION
%token SEXDRIVE
%token PREGNANT


%token WTOKEN
%token SSTOKEN
%token STOKEN
%token SITOKEN
%token ETOKEN
%token CTOKEN
%token ZERO
%token ULONG
%token LONG


%%


expression: /* empty */
|
action
;


action: ACTION LB actor act_arg RB
;


actor: FROM narg2
;


act_arg: act_stmt
|
act_arg act_stmt
;


act_stmt: ACT LB act RB
;


act: TURNBODY int
|
GO LB VELOCITY sarg DIR si_arg RB

|
TAKE sarg /* Telling with which hand */
|
PUT LB put_arg RB
|
MOVE LB WITH sarg ENDPOINT earg
ENERGY int LAYER int RB
|
SAY LB VOICEDATA voice_arg ENERGY int RB
|
INTERN LB intern_arg RB
|
EAT LB ZERO RB
|
DRINK LB ZERO RB
|
SLEEP LB ZERO RB
|
AWAKE LB ZERO RB
|
PAIRING LB ZERO RB
|
LOGOUT LB ZERO RB
;


intern_arg: necessary
|
necessary possible
;


necessary: WEIGHT int SMELL int4 SMELL_INTENSITY int
TASTE sarg NOISE sarg NOISE_INTENSITY int
;


possible: ENERGY int THIRST int AGGRESSION int SEXDRIVE int PREGNANT targ
;


put_arg: WITH sarg AT sarg
;


voice_arg: LB speech_act RB
;


speech_act: ZERO
|
utterance
|
utterance ETOKEN
|
ETOKEN
;


utterance: word
|
utterance word
|
utterance CTOKEN word
;


word: STOKEN
|
SSTOKEN
|
WTOKEN
;


/***************************************************
* LEXICON
***************************************************/


earg: int3
|
sarg
;


sarg: LB STOKEN RB
|
LB ZERO RB
|
LB SITOKEN RB
;


si_arg: LB STOKEN LONG RB
;


narg2: LB nargument nargument RB
;


nargument: ZERO
|
STOKEN
|
SITOKEN
;


targ: LB LONG LONG RB
;


int: LB LONG RB
;


int2: LB LONG LONG RB
;


int3: LB LONG LONG LONG RB
;


int4: LB LONG LONG LONG LONG RB
;



Comments are welcomed to kip-ml@inm.de
INM

Daimlerstrasse 32, 60314 Frankfurt am Main, Deutschland. Tel +49- (0)69-941963-0, Tel-Gerd: +49- (0)69-941963-10