Types
LexType: TYPE ~ {ucAlpha, lcAlpha, digit, decimalPoint, backSpace, singleCharTemplate, templateDelimiter, symbolDelimiter, other};
TokenType: TYPE ~ {integer, real, variable, template, symbol, none};
KbBuffer: TYPE ~ RECORD[type: TokenType ← none, data: ROPE, savedWrapArg: DisplayExpr ← NIL];
ParseAction: TYPE ~ REF ParseActionRep;
ReplaceAction: TYPE ~ replace ParseActionRep;
BeginMultiCharTemplateAction: TYPE ~ beginMultiCharTemplate ParseActionRep;
FinishMultiCharTemplateAction: TYPE ~ finishMultiCharTemplate ParseActionRep;
WrapAction: TYPE ~ wrap ParseActionRep;
UndoAction: TYPE ~ undo ParseActionRep;
NoAction: TYPE ~ none ParseActionRep;
ParseActionRep:
TYPE ~
RECORD [
SELECT type:*
FROM
beginMultiCharTemplate => [
oldSelect: ATOM -- old selection flavor which contains expr to be wrapped
],
finishMultiCharTemplate => [
class: ATOM -- class for template wrapper
],
replace => [
oldSelect: ATOM, -- old selection flavor which contains expr to replace
construct: TokenType, -- new expression to be constructed
fromRope: ROPE, -- data for construction
newSelect: ATOM -- selection flavor to select as after replacement
],
wrap => [
selection: ATOM, -- old selection flavor
class: ATOM -- class for template wrapper
],
undo => NULL,
none => NULL -- nothing
ENDCASE
];