<<
/* featpars.dlg -- DLG Description of scanner
 *
 * Generated from: featgram.g
 *
 * Terence Parr, Will Cohen, and Hank Dietz: 1989-2001
 * Purdue University Electrical Engineering
 * With AHPCRC, University of Minnesota
 * ANTLR Version 1.33MR33
 */

#define ANTLR_VERSION	13333
#include "pcctscfg.h"
#include "pccts_stdio.h"

/* --- This section will be included in all feat*.c files created. --- */

#include <stdlib.h>	/* For exit in err.h xxx */
#include <string.h>

#include <stdio.h>

#include "common.h"
#include "feat.h"
#include "MMFX.h"
#include "OS_2.h"
#include "hhea.h"
#include "vmtx.h"
#include "dynarr.h"

#define MAX_TOKEN	64

extern featCtx h;	/* Not reentrant; see featNew() comments */
extern hotCtx g;

typedef union
{
  long lval;
  unsigned long ulval;
  char text[MAX_TOKEN];
} Attrib;

void zzcr_attr(Attrib *attr, int type, char *text);

  
#include "antlr.h"
#include "feattoks.h"
#include "dlgdef.h"
LOOKAHEAD

void
#ifdef __USE_PROTOS
zzerraction()
#else
zzerraction()
#endif
{
	(*zzerr)("invalid token");
	zzadvance();
	zzskip();
}
>>


%%START

@
	<<
		NLA = Eof;
    
    if (featCloseIncludeFile(g, 0))
    zzskip();			/* For an included file */
    else
    featWrapUpFeatFile();	/* For main feature file */
	>>

#~[\r\n]*
	<<
		NLA = 31;
    zzskip();  
	>>

[\ \t]+
	<<
		NLA = 32;
    zzskip();  
	>>

\r\n
	<<
		NLA = 33;
    zzskip(); zzline++;  
	>>

[\r\n]
	<<
		NLA = 34;
    zzskip(); zzline++;  
	>>

include
	<<
		NLA = K_include;
    zzmode(INCLUDE_FILE);
    featSetIncludeReturnMode(START);
    zzskip();  
	>>

feature
	<<
		NLA = K_feature;
    zzmode(TAG_MODE);  
	>>

table
	<<
		NLA = K_table;
	>>

script
	<<
		NLA = K_script;
    zzmode(TAG_MODE);  
	>>

language
	<<
		NLA = K_language;
    zzmode(TAG_MODE);  
	>>

languagesystem
	<<
		NLA = K_languagesystem;
    zzmode(TAG_MODE);  
	>>

subtable
	<<
		NLA = K_subtable;
	>>

lookup
	<<
		NLA = K_lookup;
    zzmode(LABEL_MODE);  
	>>

lookupflag
	<<
		NLA = K_lookupflag;
	>>

RightToLeft
	<<
		NLA = K_RightToLeft;
	>>

IgnoreBaseGlyphs
	<<
		NLA = K_IgnoreBaseGlyphs;
	>>

IgnoreLigatures
	<<
		NLA = K_IgnoreLigatures;
	>>

IgnoreMarks
	<<
		NLA = K_IgnoreMarks;
	>>

UseMarkFilteringSet
	<<
		NLA = K_UseMarkFilteringSet;
	>>

MarkAttachmentType
	<<
		NLA = K_MarkAttachmentType;
	>>

(anonymous|anon)
	<<
		NLA = K_anon;
    featSetTagReturnMode(ANON_HDR1_MODE);
    zzmode(TAG_MODE);  
	>>

includeDFLT
	<<
		NLA = K_includeDFLT;
	>>

excludeDFLT
	<<
		NLA = K_excludeDFLT;
	>>

include_dflt
	<<
		NLA = K_include_dflt;
	>>

exclude_dflt
	<<
		NLA = K_exclude_dflt;
	>>

useExtension
	<<
		NLA = K_useExtension;
	>>

<
	<<
		NLA = K_BeginValue;
	>>

>
	<<
		NLA = K_EndValue;
	>>

enumerate|enum
	<<
		NLA = K_enumerate;
	>>

except
	<<
		NLA = K_except;
	>>

ignore
	<<
		NLA = K_ignore;
	>>

substitute|sub
	<<
		NLA = K_substitute;
	>>

reversesub|rsub
	<<
		NLA = K_reverse;
	>>

by
	<<
		NLA = K_by;
	>>

from
	<<
		NLA = K_from;
	>>

position|pos
	<<
		NLA = K_position;
	>>

parameters
	<<
		NLA = K_parameters;
	>>

featureNames
	<<
		NLA = K_feat_names;
	>>

cvParameters
	<<
		NLA = K_cv_params;
	>>

FeatUILabelNameID
	<<
		NLA = K_cvUILabel;
	>>

FeatUITooltipTextNameID
	<<
		NLA = K_cvToolTip;
	>>

SampleTextNameID
	<<
		NLA = K_cvSampletext;
	>>

ParamUILabelNameID
	<<
		NLA = K_cvParameterLabel;
	>>

Character
	<<
		NLA = K_cvCharacter;
	>>

sizemenuname
	<<
		NLA = K_sizemenuname;
	>>

contourpoint
	<<
		NLA = K_contourpoint;
	>>

device
	<<
		NLA = K_device;
	>>

anchor
	<<
		NLA = K_anchor;
	>>

anchorDef
	<<
		NLA = K_anchordef;
	>>

valueRecordDef
	<<
		NLA = K_valueRecordDef;
	>>

mark
	<<
		NLA = K_mark;
	>>

markClass
	<<
		NLA = K_markClass;
	>>

cursive
	<<
		NLA = K_cursive;
	>>

base
	<<
		NLA = K_markBase;
	>>

ligature|lig
	<<
		NLA = K_markLigature;
	>>

ligComponent
	<<
		NLA = K_LigatureComponent;
	>>

caret
	<<
		NLA = K_caret;
	>>

NULL
	<<
		NLA = K_NULL;
	>>

BASE
	<<
		NLA = K_BASE;
	>>

HorizAxis.BaseTagList
	<<
		NLA = K_HorizAxis_BaseTagList;
    zzmode(TAG_MODE);  
	>>

HorizAxis.BaseScriptList
	<<
		NLA = K_HorizAxis_BaseScriptList;
    zzmode(TAG_MODE);  
	>>

VertAxis.BaseTagList
	<<
		NLA = K_VertAxis_BaseTagList;
    zzmode(TAG_MODE);  
	>>

VertAxis.BaseScriptList
	<<
		NLA = K_VertAxis_BaseScriptList;
    zzmode(TAG_MODE);  
	>>

GDEF
	<<
		NLA = K_GDEF;
	>>

GlyphClassDef
	<<
		NLA = K_GlyphClassDef;
	>>

Attach
	<<
		NLA = K_Attach;
	>>

MarkAttachClass
	<<
		NLA = K_GDEFMarkAttachClass;
	>>

LigatureCaretByPos
	<<
		NLA = K_LigatureCaret1;
	>>

LigatureCaretByIndex
	<<
		NLA = K_LigatureCaret2;
	>>

LigatureCaretByDev
	<<
		NLA = K_LigatureCaret3;
	>>

head
	<<
		NLA = K_head;
	>>

FontRevision
	<<
		NLA = K_FontRevision;
	>>

hhea
	<<
		NLA = K_hhea;
	>>

Ascender
	<<
		NLA = K_Ascender;
	>>

Descender
	<<
		NLA = K_Descender;
	>>

LineGap
	<<
		NLA = K_LineGap;
	>>

CaretOffset
	<<
		NLA = K_CaretOffset;
	>>

name
	<<
		NLA = K_name;
	>>

nameid
	<<
		NLA = K_nameid;
	>>

OS/2
	<<
		NLA = K_OS_2;
	>>

FSType
	<<
		NLA = K_FSType;
	>>

fsType
	<<
		NLA = K_FSType2;
	>>

LowerOpSize
	<<
		NLA = K_LowerOpticalPointSize;
	>>

UpperOpSize
	<<
		NLA = K_UpperOpticalPointSize;
	>>

Panose
	<<
		NLA = K_Panose;
	>>

TypoAscender
	<<
		NLA = K_TypoAscender;
	>>

TypoDescender
	<<
		NLA = K_TypoDescender;
	>>

TypoLineGap
	<<
		NLA = K_TypoLineGap;
	>>

winAscent
	<<
		NLA = K_winAscent;
	>>

winDescent
	<<
		NLA = K_winDescent;
	>>

XHeight
	<<
		NLA = K_XHeight;
	>>

CapHeight
	<<
		NLA = K_CapHeight;
	>>

UnicodeRange
	<<
		NLA = K_UnicodeRange;
	>>

CodePageRange
	<<
		NLA = K_CodePageRange;
	>>

WeightClass
	<<
		NLA = K_WeightClass;
	>>

WidthClass
	<<
		NLA = K_WidthClass;
	>>

Vendor
	<<
		NLA = K_Vendor;
	>>

vhea
	<<
		NLA = K_vhea;
	>>

VertTypoAscender
	<<
		NLA = K_VertTypoAscender;
	>>

VertTypoDescender
	<<
		NLA = K_VertTypoDescender;
	>>

VertTypoLineGap
	<<
		NLA = K_VertTypoLineGap;
	>>

vmtx
	<<
		NLA = K_vmtx;
	>>

VertOriginY
	<<
		NLA = K_VertOriginY;
	>>

VertAdvanceY
	<<
		NLA = K_VertAdvanceY;
	>>

[0-9]+.[0-9]+
	<<
		NLA = T_FONTREV;
	>>

0x[0-9a-fA-F]+|0[0-7]+
	<<
		NLA = T_NUMEXT;
	>>

({\-}[1-9][0-9]*)|0
	<<
		NLA = T_NUM;
	>>

\@[A-Za-z_0-9.\-]+
	<<
		NLA = T_GCLASS;
	>>

\\[0-9]+
	<<
		NLA = T_CID;
	>>

{\\}[A-Za-z_\.]+[A-Za-z_0-9.\-\+\*:\~^!]*
	<<
		NLA = T_GNAME;
	>>

\"
	<<
		NLA = T_STRING;
    zzmode(STRING_MODE);  
	>>

\[
	<<
		NLA = 140;
	>>

\-
	<<
		NLA = 141;
	>>

\]
	<<
		NLA = 142;
	>>

0
	<<
		NLA = 143;
	>>

,
	<<
		NLA = 144;
	>>

'
	<<
		NLA = 145;
	>>

;
	<<
		NLA = 146;
	>>

\{
	<<
		NLA = 147;
	>>

\}
	<<
		NLA = 148;
	>>

=
	<<
		NLA = 149;
	>>


%%TAG_MODE

@
	<<
		NLA = Eof;
	>>

[\ \t]+
	<<
		NLA = 2;
    zzskip();  
	>>

\r\n
	<<
		NLA = 3;
    zzskip(); zzline++;  
	>>

[\r\n]
	<<
		NLA = 4;
    zzskip(); zzline++;  
	>>

include
	<<
		NLA = K_include;
    
    zzmode(INCLUDE_FILE);
    featSetIncludeReturnMode(TAG_MODE);
    zzskip();
	>>

;
	<<
		NLA = 6;
    zzskip(); zzmode(featGetTagReturnMode());  
	>>

[\0x21-\0x3a\0x3c-\0x7E]{[\0x21-\0x3a\0x3c-\0x7E]}{[\0x21-\0x3a\0x3c-\0x7E]}{[\0x21-\0x3a\0x3c-\0x7E]}
	<<
		NLA = T_TAG;
    zzmode(featGetTagReturnMode());  
	>>


%%LABEL_MODE

@
	<<
		NLA = Eof;
	>>

[\ \t]+
	<<
		NLA = 8;
    zzskip();  
	>>

\r\n
	<<
		NLA = 9;
    zzskip(); zzline++;  
	>>

[\r\n]
	<<
		NLA = 10;
    zzskip(); zzline++;  
	>>

[A-Za-z_0-9.]+
	<<
		NLA = T_LABEL;
    zzmode(START);  
	>>


%%INCLUDE_FILE

@
	<<
		NLA = Eof;
	>>

[\ \t]+
	<<
		NLA = 12;
    zzskip();  
	>>

\r\n
	<<
		NLA = 13;
    zzskip(); zzline++;  
	>>

[\r\n]
	<<
		NLA = 14;
    zzskip(); zzline++;  
	>>

\(~[\)]+\)[#; \t\r\n]
	<<
		NLA = INCLFILE;
    
    zzmode(featGetIncludeReturnMode());
    DF(2, (stderr, "# in(%s)\n", zzlextext));
    zzskip();
    featOpenIncludeFile(g, featTrimParensSpaces(zzlextext));
	>>


%%ANON_HDR1_MODE

@
	<<
		NLA = Eof;
    featUnexpectedEOF();  
	>>

[\ \t]+
	<<
		NLA = 16;
    zzskip();  
	>>

\r\n
	<<
		NLA = 17;
    zzskip(); zzline++;  
	>>

[\r\n]
	<<
		NLA = 18;
    zzskip(); zzline++;  
	>>

\{
	<<
		NLA = 19;
    zzskip(); zzmode(ANON_HDR2_MODE);  
	>>


%%ANON_HDR2_MODE

@
	<<
		NLA = Eof;
    featUnexpectedEOF();  
	>>

#~[\r\n]*
	<<
		NLA = 20;
    zzskip();  
	>>

[\ \t]+
	<<
		NLA = 21;
    zzskip();  
	>>

\r\n
	<<
		NLA = 22;
    zzskip(); zzline++; zzmode(ANON_BODY_MODE);  
	>>

[\r\n]
	<<
		NLA = 23;
    zzskip(); zzline++; zzmode(ANON_BODY_MODE);  
	>>


%%ANON_BODY_MODE

@
	<<
		NLA = Eof;
    featUnexpectedEOF();  
	>>

\r\n
	<<
		NLA = 24;
    
    if (featAddAnonDataChar(zzlextext[0], 0) ||
    featAddAnonDataChar(zzlextext[1], 1 /*eol*/))
    zzmode(START);
    zzskip();
    zzline++;
	>>

[\r\n]
	<<
		NLA = 25;
    
    if (featAddAnonDataChar(zzlextext[0], 1 /*eol*/))
    zzmode(START);
    zzskip();
    zzline++;
	>>

~[]
	<<
		NLA = 26;
    featAddAnonDataChar(zzlextext[0], 0); zzskip();  
	>>


%%STRING_MODE

@
	<<
		NLA = Eof;
    featUnexpectedEOF();  
	>>

\"
	<<
		NLA = 27;
    zzmode(START); zzskip();  
	>>

\r\n
	<<
		NLA = 28;
    zzskip(); zzline++;  
	>>

[\r\n]
	<<
		NLA = 29;
    zzskip(); zzline++;  
	>>

[\0x20-\0x7E]
	<<
		NLA = 30;
    featAddNameStringChar(zzlextext[0]); zzskip();  
	>>

%%
