--
-- An instance of this template must have a $Export section and the export_terminals option
--
-- Macros that may be redefined in an instance of this template
--
--     $eof_token
--     $additional_interfaces
--     $super_stream_class -- subclass com.ibm.lpg.LpgLexStream for getKind
--     $prs_stream_class -- use /.PrsStream./ if not subclassing
--     $super_class
--
-- B E G I N N I N G   O F   T E M P L A T E   LexerTemplateF
--
%Options programming_language=java,margin=4
%Options table
%options action-block=("*.java", "/.", "./")
%options ParseTable=lpg.runtime.ParseTable
%Options prefix=Char_

--
-- This template requires that the name of the EOF token be set
-- to EOF and that the prefix be "Char_" to be consistent with
-- KeywordTemplateD.
--
%Eof
    EOF
%End

--
-- This template also requires that the name of the parser EOF
-- Token to be exported be set to EOF_TOKEN
--
%Export
    EOF_TOKEN
%End

%Define
    --
    -- Macros that are be needed in an instance of this template
    --
    $eof_token /.$_EOF_TOKEN./

    $additional_interfaces /../
    $super_stream_class /.$file_prefix$LpgLexStream./
    $prs_stream_class /.IPrsStream./
    $super_class /.Object./

    $prs_stream /. // macro prs_stream is deprecated. Use function getPrsStream
                  getPrsStream()./
    $setSym1 /. // macro setSym1 is deprecated. Use function setResult
               lexParser.setSym1./
    $setResult /. // macro setResult is deprecated. Use function setResult
                 lexParser.setSym1./
    $getSym /. // macro getSym is deprecated. Use function getLastToken
              lexParser.getSym./
    $getToken /. // macro getToken is deprecated. Use function getToken
                lexParser.getToken./
    $getLeftSpan /. // macro getLeftSpan is deprecated. Use function getLeftSpan
                   lexParser.getFirstToken./
    $getRightSpan /. // macro getRightSpan is deprecated. Use function getRightSpan
                    lexParser.getLastToken./

    --
    -- Macros useful for specifying actions
    --
    $Header
    /.
                //
                // Rule $rule_number:  $rule_text
                //
                ./

    $DefaultAction
    /.$Header$case $rule_number: { ./

    $BeginAction /.$DefaultAction./

    $EndAction
    /.            break;
                }./

    $BeginJava
    /.$BeginAction
                $symbol_declarations./

    $EndJava /.$EndAction./

    $NoAction
    /.$Header$case $rule_number:
                    break; ./

    $BeginActions
    /.
        public void ruleAction(int ruleNumber)
        {
            switch(ruleNumber)
            {./

    $SplitActions
    /.
                    default:
                        ruleAction$rule_number(ruleNumber);
                        break;
                }
                return;
            }

            public void ruleAction$rule_number(int ruleNumber)
            {
                switch (ruleNumber)
                {./

    $EndActions
    /.
                default:
                    break;
            }
            return;
        }./
%End

%Globals
    /.import lpg.runtime.*;
    ./
%End

%Headers
    /.
    public class $action_type extends $super_class implements RuleAction$additional_interfaces
    {
        private $super_stream_class lexStream;

        private static ParseTable prs = new $prs_type();
        public ParseTable getParseTable() { return prs; }

        private LexParser lexParser = new LexParser();
        public LexParser getParser() { return lexParser; }

        public int getToken(int i) { return lexParser.getToken(i); }
        public int getRhsFirstTokenIndex(int i) { return lexParser.getFirstToken(i); }
        public int getRhsLastTokenIndex(int i) { return lexParser.getLastToken(i); }

        public int getLeftSpan() { return lexParser.getToken(1); }
        public int getRightSpan() { return lexParser.getLastToken(); }

        public void resetKeywordLexer()
        {
            if (kwLexer == null)
                  this.kwLexer = new $kw_lexer_class(lexStream.getInputChars(), $_IDENTIFIER);
            else this.kwLexer.setInputChars(lexStream.getInputChars());
        }

        public void reset(String filename, int tab) throws java.io.IOException
        {
            lexStream = new $super_stream_class(filename, tab);
            lexParser.reset((ILexStream) lexStream, prs, (RuleAction) this);
            resetKeywordLexer();
        }

        public void reset(char[] input_chars, String filename)
        {
            reset(input_chars, filename, 1);
        }

        public void reset(char[] input_chars, String filename, int tab)
        {
            lexStream = new $super_stream_class(input_chars, filename, tab);
            lexParser.reset((ILexStream) lexStream, prs, (RuleAction) this);
            resetKeywordLexer();
        }

        public $action_type(String filename, int tab) throws java.io.IOException
        {
            reset(filename, tab);
        }

        public $action_type(char[] input_chars, String filename, int tab)
        {
            reset(input_chars, filename, tab);
        }

        public $action_type(char[] input_chars, String filename)
        {
            reset(input_chars, filename, 1);
        }

        public $action_type() {}

        public ILexStream getILexStream() { return lexStream; }

        /**
         * @deprecated replaced by {@link #getILexStream()}
         */
        public ILexStream getLexStream() { return lexStream; }

        private void initializeLexer($prs_stream_class prsStream, int start_offset, int end_offset)
        {
            if (lexStream.getInputChars() == null)
                throw new NullPointerException("LexStream was not initialized");
            lexStream.setPrsStream(prsStream);
            prsStream.makeToken(start_offset, end_offset, 0); // Token list must start with a bad token
        }

        private void addEOF($prs_stream_class prsStream, int end_offset)
        {
            prsStream.makeToken(end_offset, end_offset, $eof_token); // and end with the end of file token
            prsStream.setStreamLength(prsStream.getSize());
        }

        public void lexer($prs_stream_class prsStream)
        {
            lexer(null, prsStream);
        }

        public void lexer(Monitor monitor, $prs_stream_class prsStream)
        {
            initializeLexer(prsStream, 0, -1);
            lexParser.parseCharacters(monitor);  // Lex the input characters
            addEOF(prsStream, lexStream.getStreamIndex());
        }

        public void lexer($prs_stream_class prsStream, int start_offset, int end_offset)
        {
            lexer(null, prsStream, start_offset, end_offset);
        }

        public void lexer(Monitor monitor, $prs_stream_class prsStream, int start_offset, int end_offset)
        {
            if (start_offset <= 1)
                 initializeLexer(prsStream, 0, -1);
            else initializeLexer(prsStream, start_offset - 1, start_offset - 1);

            lexParser.parseCharacters(monitor, start_offset, end_offset);

            addEOF(prsStream, (end_offset >= lexStream.getStreamIndex() ? lexStream.getStreamIndex() : end_offset + 1));
        }

        public IPrsStream.Range incrementalLexer(char[] input_chars, int start_change_offset, int end_change_offset) {
            int offset_adjustment = input_chars.length - lexStream.getStreamLength();
//*System.out.println("The offset adjustment is " + offset_adjustment);
            if (start_change_offset <= 0 && start_change_offset < input_chars.length)
                throw new IndexOutOfBoundsException("The start offset " + start_change_offset +
                                                    " is out of bounds for range 0.." + (input_chars.length - 1));
            if (end_change_offset <= 0 && end_change_offset < input_chars.length)
                throw new IndexOutOfBoundsException("The end offset " + end_change_offset +
                                                    " is out of bounds for range 0.." + (input_chars.length - 1));

            //
            // Get the potential list of tokens to be rescanned
            //
            java.util.ArrayList<IToken> affected_tokens = lexStream.getIPrsStream().incrementalResetAtCharacterOffset(start_change_offset);

            //
            // If the change occured between the first two affected tokens (or adjunct) and not immediately
            // on the characted after the first token (or adjunct), restart the scanning after the first
            // affected token. Otherwise, rescan the first token.
            //
            int affected_index = 0;
            int repair_offset = start_change_offset;
            if (affected_tokens.size() > 0) {
                if (affected_tokens.get(0).getEndOffset() + 1 < start_change_offset) {
                     repair_offset = affected_tokens.get(0).getEndOffset() + 1;
                     if (affected_tokens.get(0) instanceof Token)
                         lexStream.getIPrsStream().makeToken(affected_tokens.get(0), 0);
                    else lexStream.getIPrsStream().makeAdjunct(affected_tokens.get(0), 0);
                    affected_index++;
                }
                else repair_offset = affected_tokens.get(0).getStartOffset();
            }

            lexStream.setInputChars(input_chars);
            lexStream.setStreamLength(input_chars.length);
            lexStream.computeLineOffsets(repair_offset);

            int first_new_token_index = lexStream.getIPrsStream().getTokens().size(),
                first_new_adjunct_index = lexStream.getIPrsStream().getAdjuncts().size();

            resetKeywordLexer();
            lexParser.resetTokenStream(repair_offset);
            int next_offset;
            do {
//*System.out.println("Scanning token starting at " + (lexStream.peek() - 1));
                next_offset = lexParser.incrementalParseCharacters();
//*System.out.print("***Remaining string: \"");
//*for (int i = next_offset; i < input_chars.length; i++)
//*System.out.print(input_chars[i]);
//*System.out.println("\"");
                while (affected_index < affected_tokens.size() &&
                       affected_tokens.get(affected_index).getStartOffset() + offset_adjustment < next_offset)
//*{
//*System.out.println("---Skipping token " + affected_index + ": \"" + affected_tokens.get(affected_index).toString() +
//*"\" starting at adjusted offset " + (affected_tokens.get(affected_index).getStartOffset() + offset_adjustment));
                    affected_index++;
//*}
            } while(next_offset <= end_change_offset &&          // still in the damage region and ...
                    (affected_index < affected_tokens.size() &&  // not resynchronized with a token in the list of affected tokens
                     affected_tokens.get(affected_index).getStartOffset() + offset_adjustment != next_offset));

            //
            // If any new tokens were added, compute the first and the last one.
            //
            IToken first_new_token = null,
                   last_new_token = null;
            if (first_new_token_index < lexStream.getIPrsStream().getTokens().size()) {
                first_new_token = lexStream.getIPrsStream().getTokenAt(first_new_token_index);
                last_new_token = lexStream.getIPrsStream().getTokenAt(lexStream.getIPrsStream().getTokens().size() - 1);
            }
            //
            // If an adjunct was added prior to the first real token, chose it instead as the first token.
            // Similarly, if adjucts were added after the last token, chose the last adjunct added as the last token.
            //
            if (first_new_adjunct_index < lexStream.getIPrsStream().getAdjuncts().size()) {
                if (first_new_token == null ||
                    lexStream.getIPrsStream().getAdjunctAt(first_new_adjunct_index).getStartOffset() <
                    first_new_token.getStartOffset()) {
                    first_new_token = lexStream.getIPrsStream().getAdjunctAt(first_new_adjunct_index);
                }
                if (last_new_token == null ||
                    lexStream.getIPrsStream().getAdjunctAt(lexStream.getIPrsStream().getAdjuncts().size() - 1).getEndOffset() >
                    last_new_token.getEndOffset()) {
                    last_new_token = lexStream.getIPrsStream().getAdjunctAt(lexStream.getIPrsStream().getAdjuncts().size() - 1);
                }
            }

            //
            // For all remainng tokens (and adjuncts) in the list of affected tokens add them to the
            // list of tokens (and adjuncts).
            //
            for (int i = affected_index; i < affected_tokens.size(); i++) {
                if (affected_tokens.get(i) instanceof Token)
                     lexStream.getIPrsStream().makeToken(affected_tokens.get(i), offset_adjustment);
                else lexStream.getIPrsStream().makeAdjunct(affected_tokens.get(i), offset_adjustment);
//*System.out.println("+++Added affected token " + i + ": \"" + affected_tokens.get(i).toString() +
//*"\" starting at adjusted offset " + (affected_tokens.get(i).getStartOffset() + offset_adjustment));
            }

            return new IPrsStream.Range(lexStream.getIPrsStream(), first_new_token, last_new_token);
        }

        /**
         * If a parse stream was not passed to this Lexical analyser then we
         * simply report a lexical error. Otherwise, we produce a bad token.
         */
        public void reportLexicalError(int startLoc, int endLoc) {
            IPrsStream prs_stream = lexStream.getIPrsStream();
            if (prs_stream == null)
                lexStream.reportLexicalError(startLoc, endLoc);
            else {
                //
                // Remove any token that may have been processed that fall in the
                // range of the lexical error... then add one error token that spans
                // the error range.
                //
                for (int i = prs_stream.getSize() - 1; i > 0; i--) {
                    if (prs_stream.getStartOffset(i) >= startLoc)
                         prs_stream.removeLastToken();
                    else break;
                }
                prs_stream.makeToken(startLoc, endLoc, 0); // add an error token to the prsStream
            }
        }
    ./
%End

%Rules
    /.$BeginActions./
%End

%Trailers
    /.
        $EndActions
    }
    ./
%End

--
-- E N D   O F   T E M P L A T E
--


--
-- An instance of this template must have a $Export section and the export_terminals option
--
-- Macros that may be redefined in an instance of this template
--
--     $eof_token
--     $additional_interfaces
--     $super_stream_class -- subclass com.ibm.lpg.Utf8LpgLexStream for getKind
--     $prs_stream_class -- use /.PrsStream./ if not subclassing
--
-- B E G I N N I N G   O F   T E M P L A T E   LexerTemplateD
--
%Options programming_language=csharp,margin=4
%Options table
%options action-block=("*.cs", "/.", "./")
%options ParseTable=LPG2.Runtime.ParseTable
%Options prefix=Char_

--
-- This template requires that the name of the EOF token be set
-- to EOF and that the prefix be "Char_" to be consistent with
-- KeywordTemplateD.
--
%Eof
    EOF
%End

--
-- This template also requires that the name of the parser EOF
-- Token to be exported be set to EOF_TOKEN
--
%Export
    EOF_TOKEN
%End

%Define
    --
    -- Macros that are be needed in an instance of this template
    --
    $eof_token /.$_EOF_TOKEN./

    $additional_interfaces /../
    $super_stream_class /.$file_prefix$Utf8LpgLexStream./
    $prs_stream_class /.IPrsStream./
    $super_class /.object./

    --
    -- Macros useful for specifying actions
    --
    $Header
    /.
                //
                // Rule $rule_number:  $rule_text
                //
                ./

    $DefaultAction
    /.$Header$case $rule_number: { ./

    $BeginAction /.$DefaultAction./

    $EndAction
    /.          break;
                }./

    $BeginJava
    /.$BeginAction
                $symbol_declarations./

    $EndJava /.$EndAction./

    $NoAction
    /.$Header$case $rule_number:
                    break; ./

    $BeginActions
    /.
        public void ruleAction( int ruleNumber)
        {
            switch(ruleNumber)
            {./

    $SplitActions
    /.
	            default:
	                ruleAction$rule_number(ruleNumber);
	                break;
	        }
	        return;
	    }

	    public void ruleAction$rule_number(int ruleNumber)
	    {
	        switch (ruleNumber)
	        {./

    $EndActions
    /.
                default:
                    break;
            }
            return;
        }./
%End

%Globals
    /.
    using LPG2.Runtime;
    using System;
    ./
%End

%Headers
    /.
    public class $action_type : $super_class , RuleAction$additional_interfaces
    {
        private $super_stream_class utf8LexStream;

        private static ParseTable prs = new $prs_type();
        public ParseTable getParseTable() { return prs; }

        private LexParser lexParser = new LexParser();
        public LexParser getParser() { return lexParser; }

        public int getToken(int i) { return lexParser.getToken(i); }
        public int getRhsFirstTokenIndex(int i) { return lexParser.getFirstToken(i); }
        public int getRhsLastTokenIndex(int i) { return lexParser.getLastToken(i); }

        public int getLeftSpan() { return lexParser.getToken(1); }
        public int getRightSpan() { return lexParser.getLastToken(); }

        public void resetKeywordLexer()
        {
            if (kwLexer == null)
                  this.kwLexer = new $kw_lexer_class(utf8LexStream.getInputBytes(), $_IDENTIFIER);
            else this.kwLexer.setInputBytes(utf8LexStream.getInputBytes());
        }

        public void reset(string filename, int tab)
        {
            utf8LexStream = new $super_stream_class(filename, tab);
            lexParser.reset((ILexStream) utf8LexStream, prs, (RuleAction) this);
            resetKeywordLexer();
        }

        public void reset(byte[] input_bytes, string filename)
        {
            reset(input_bytes, filename, 1);
        }

        public void reset(byte[] input_bytes, string filename, int tab)
        {
            utf8LexStream = new $super_stream_class(input_bytes, filename, tab);
            lexParser.reset((ILexStream) utf8LexStream, prs, (RuleAction) this);
            resetKeywordLexer();
        }

        public $action_type(string filename, int tab)
        {
            reset(filename, tab);
        }

        public $action_type(byte[] input_bytes, string filename, int tab)
        {
            reset(input_bytes, filename, tab);
        }

        public $action_type(byte[] input_bytes, string filename)
        {
            reset(input_bytes, filename, 1);
        }

        public $action_type() {}

        public ILexStream getILexStream() { return utf8LexStream; }

        /**
         * @deprecated replaced by {@link #getILexStream()}
         */
        public ILexStream getLexStream() { return utf8LexStream; }

        private void initializeLexer($prs_stream_class prsStream, int start_offset, int end_offset)
        {
            if (utf8LexStream.getInputBytes() == null)
                throw new NullReferenceException("LexStream was not initialized");
            utf8LexStream.setPrsStream(prsStream);
            prsStream.makeToken(start_offset, end_offset, 0); // Token list must start with a bad token
        }

        public void lexer($prs_stream_class prsStream)
        {
            lexer(null, prsStream);
        }

        public void lexer(Monitor monitor, $prs_stream_class prsStream)
        {
            if (utf8LexStream.getInputBytes() == null)
                throw new NullReferenceException("Utf8LexStream was not initialized");

            utf8LexStream.setPrsStream(prsStream);

            prsStream.makeToken(0, 0, 0); // Token list must start with a bad token

            lexParser.parseCharacters(monitor);  // Lex the input characters

            int i = utf8LexStream.getStreamIndex();
            prsStream.makeToken(i, i, $eof_token); // and end with the end of file token
            prsStream.setStreamLength(prsStream.getSize());

            return;
        }
    ./
%End

%Rules
    /.$BeginActions./
%End

%Trailers
    /.
        $EndActions
    }
    ./
%End

--
-- E N D   O F   T E M P L A T E
--


%Globals
    /.
    import { %exp_type } from ".\/%exp_type";
    ./
%End
%Trailers
/.
      export  class  %super_stream_class  extends LpgLexStream
        {
        public static tokenKind  : number[] =
        [
            %sym_type.%prefix%CtlCharNotWS%suffix%,    // 000    0x00
            %sym_type.%prefix%CtlCharNotWS%suffix%,    // 001    0x01
            %sym_type.%prefix%CtlCharNotWS%suffix%,    // 002    0x02
            %sym_type.%prefix%CtlCharNotWS%suffix%,    // 003    0x03
            %sym_type.%prefix%CtlCharNotWS%suffix%,    // 004    0x04
            %sym_type.%prefix%CtlCharNotWS%suffix%,    // 005    0x05
            %sym_type.%prefix%CtlCharNotWS%suffix%,    // 006    0x06
            %sym_type.%prefix%CtlCharNotWS%suffix%,    // 007    0x07
            %sym_type.%prefix%CtlCharNotWS%suffix%,    // 008    0x08
            %sym_type.%prefix%HT%suffix%,              // 009    0x09
            %sym_type.%prefix%LF%suffix%,              // 010    0x0A
            %sym_type.%prefix%CtlCharNotWS%suffix%,    // 011    0x0B
            %sym_type.%prefix%FF%suffix%,              // 012    0x0C
            %sym_type.%prefix%CR%suffix%,              // 013    0x0D
            %sym_type.%prefix%CtlCharNotWS%suffix%,    // 014    0x0E
            %sym_type.%prefix%CtlCharNotWS%suffix%,    // 015    0x0F
            %sym_type.%prefix%CtlCharNotWS%suffix%,    // 016    0x10
            %sym_type.%prefix%CtlCharNotWS%suffix%,    // 017    0x11
            %sym_type.%prefix%CtlCharNotWS%suffix%,    // 018    0x12
            %sym_type.%prefix%CtlCharNotWS%suffix%,    // 019    0x13
            %sym_type.%prefix%CtlCharNotWS%suffix%,    // 020    0x14
            %sym_type.%prefix%CtlCharNotWS%suffix%,    // 021    0x15
            %sym_type.%prefix%CtlCharNotWS%suffix%,    // 022    0x16
            %sym_type.%prefix%CtlCharNotWS%suffix%,    // 023    0x17
            %sym_type.%prefix%CtlCharNotWS%suffix%,    // 024    0x18
            %sym_type.%prefix%CtlCharNotWS%suffix%,    // 025    0x19
            %sym_type.%prefix%CtlCharNotWS%suffix%,    // 026    0x1A
            %sym_type.%prefix%CtlCharNotWS%suffix%,    // 027    0x1B
            %sym_type.%prefix%CtlCharNotWS%suffix%,    // 028    0x1C
            %sym_type.%prefix%CtlCharNotWS%suffix%,    // 029    0x1D
            %sym_type.%prefix%CtlCharNotWS%suffix%,    // 030    0x1E
            %sym_type.%prefix%CtlCharNotWS%suffix%,    // 031    0x1F
            %sym_type.%prefix%Space%suffix%,           // 032    0x20
            %sym_type.%prefix%Exclamation%suffix%,     // 033    0x21
            %sym_type.%prefix%DoubleQuote%suffix%,     // 034    0x22
            %sym_type.%prefix%Sharp%suffix%,           // 035    0x23
            %sym_type.%prefix%DollarSign%suffix%,      // 036    0x24
            %sym_type.%prefix%Percent%suffix%,         // 037    0x25
            %sym_type.%prefix%Ampersand%suffix%,       // 038    0x26
            %sym_type.%prefix%SingleQuote%suffix%,     // 039    0x27
            %sym_type.%prefix%LeftParen%suffix%,       // 040    0x28
            %sym_type.%prefix%RightParen%suffix%,      // 041    0x29
            %sym_type.%prefix%Star%suffix%,            // 042    0x2A
            %sym_type.%prefix%Plus%suffix%,            // 043    0x2B
            %sym_type.%prefix%Comma%suffix%,           // 044    0x2C
            %sym_type.%prefix%Minus%suffix%,           // 045    0x2D
            %sym_type.%prefix%Dot%suffix%,             // 046    0x2E
            %sym_type.%prefix%Slash%suffix%,           // 047    0x2F
            %sym_type.%prefix%0%suffix%,               // 048    0x30
            %sym_type.%prefix%1%suffix%,               // 049    0x31
            %sym_type.%prefix%2%suffix%,               // 050    0x32
            %sym_type.%prefix%3%suffix%,               // 051    0x33
            %sym_type.%prefix%4%suffix%,               // 052    0x34
            %sym_type.%prefix%5%suffix%,               // 053    0x35
            %sym_type.%prefix%6%suffix%,               // 054    0x36
            %sym_type.%prefix%7%suffix%,               // 055    0x37
            %sym_type.%prefix%8%suffix%,               // 056    0x38
            %sym_type.%prefix%9%suffix%,               // 057    0x39
            %sym_type.%prefix%Colon%suffix%,           // 058    0x3A
            %sym_type.%prefix%SemiColon%suffix%,       // 059    0x3B
            %sym_type.%prefix%LessThan%suffix%,        // 060    0x3C
            %sym_type.%prefix%Equal%suffix%,           // 061    0x3D
            %sym_type.%prefix%GreaterThan%suffix%,     // 062    0x3E
            %sym_type.%prefix%QuestionMark%suffix%,    // 063    0x3F
            %sym_type.%prefix%AtSign%suffix%,          // 064    0x40
            %sym_type.%prefix%A%suffix%,               // 065    0x41
            %sym_type.%prefix%B%suffix%,               // 066    0x42
            %sym_type.%prefix%C%suffix%,               // 067    0x43
            %sym_type.%prefix%D%suffix%,               // 068    0x44
            %sym_type.%prefix%E%suffix%,               // 069    0x45
            %sym_type.%prefix%F%suffix%,               // 070    0x46
            %sym_type.%prefix%G%suffix%,               // 071    0x47
            %sym_type.%prefix%H%suffix%,               // 072    0x48
            %sym_type.%prefix%I%suffix%,               // 073    0x49
            %sym_type.%prefix%J%suffix%,               // 074    0x4A
            %sym_type.%prefix%K%suffix%,               // 075    0x4B
            %sym_type.%prefix%L%suffix%,               // 076    0x4C
            %sym_type.%prefix%M%suffix%,               // 077    0x4D
            %sym_type.%prefix%N%suffix%,               // 078    0x4E
            %sym_type.%prefix%O%suffix%,               // 079    0x4F
            %sym_type.%prefix%P%suffix%,               // 080    0x50
            %sym_type.%prefix%Q%suffix%,               // 081    0x51
            %sym_type.%prefix%R%suffix%,               // 082    0x52
            %sym_type.%prefix%S%suffix%,               // 083    0x53
            %sym_type.%prefix%T%suffix%,               // 084    0x54
            %sym_type.%prefix%U%suffix%,               // 085    0x55
            %sym_type.%prefix%V%suffix%,               // 086    0x56
            %sym_type.%prefix%W%suffix%,               // 087    0x57
            %sym_type.%prefix%X%suffix%,               // 088    0x58
            %sym_type.%prefix%Y%suffix%,               // 089    0x59
            %sym_type.%prefix%Z%suffix%,               // 090    0x5A
            %sym_type.%prefix%LeftBracket%suffix%,     // 091    0x5B
            %sym_type.%prefix%BackSlash%suffix%,       // 092    0x5C
            %sym_type.%prefix%RightBracket%suffix%,    // 093    0x5D
            %sym_type.%prefix%Caret%suffix%,           // 094    0x5E
            %sym_type.%prefix%_%suffix%,               // 095    0x5F
            %sym_type.%prefix%BackQuote%suffix%,       // 096    0x60
            %sym_type.%prefix%a%suffix%,               // 097    0x61
            %sym_type.%prefix%b%suffix%,               // 098    0x62
            %sym_type.%prefix%c%suffix%,               // 099    0x63
            %sym_type.%prefix%d%suffix%,               // 100    0x64
            %sym_type.%prefix%e%suffix%,               // 101    0x65
            %sym_type.%prefix%f%suffix%,               // 102    0x66
            %sym_type.%prefix%g%suffix%,               // 103    0x67
            %sym_type.%prefix%h%suffix%,               // 104    0x68
            %sym_type.%prefix%i%suffix%,               // 105    0x69
            %sym_type.%prefix%j%suffix%,               // 106    0x6A
            %sym_type.%prefix%k%suffix%,               // 107    0x6B
            %sym_type.%prefix%l%suffix%,               // 108    0x6C
            %sym_type.%prefix%m%suffix%,               // 109    0x6D
            %sym_type.%prefix%n%suffix%,               // 110    0x6E
            %sym_type.%prefix%o%suffix%,               // 111    0x6F
            %sym_type.%prefix%p%suffix%,               // 112    0x70
            %sym_type.%prefix%q%suffix%,               // 113    0x71
            %sym_type.%prefix%r%suffix%,               // 114    0x72
            %sym_type.%prefix%s%suffix%,               // 115    0x73
            %sym_type.%prefix%t%suffix%,               // 116    0x74
            %sym_type.%prefix%u%suffix%,               // 117    0x75
            %sym_type.%prefix%v%suffix%,               // 118    0x76
            %sym_type.%prefix%w%suffix%,               // 119    0x77
            %sym_type.%prefix%x%suffix%,               // 120    0x78
            %sym_type.%prefix%y%suffix%,               // 121    0x79
            %sym_type.%prefix%z%suffix%,               // 122    0x7A
            %sym_type.%prefix%LeftBrace%suffix%,       // 123    0x7B
            %sym_type.%prefix%VerticalBar%suffix%,     // 124    0x7C
            %sym_type.%prefix%RightBrace%suffix%,      // 125    0x7D
            %sym_type.%prefix%Tilde%suffix%,           // 126    0x7E

            %sym_type.%prefix%AfterASCII%suffix%,      // for all chars in range 128..65534
            %sym_type.%prefix%EOF%suffix%              // for '\uffff' or 65535
        ];

        public    getKind(i :number)  : number // Classify character at ith location
        {
            let c = (i >= this.getStreamLength() ? 0xffff : this.getIntValue(i));
            return (c < 128 // ASCII Character
                      ? %super_stream_class.tokenKind[c]
                      : c == 0xffff
                           ? %sym_type.%prefix%EOF%suffix%
                           : %sym_type.%prefix%AfterASCII%suffix%);
        }

        public  orderedExportedSymbols(): string[]  { return %exp_type.orderedTerminalSymbols; }

         constructor(fileName: string, inputChars?: string, tab?: number) {
             super(fileName, inputChars, tab);
         }
        }
./
%End
%Headers

    --
    -- Additional methods for the action class not provided in the template
    --
    /.

        //
        // The Lexer contains an array of characters as the input stream to be parsed.
        // There are methods to retrieve and classify characters.
        // The lexparser "token" is implemented simply as the index of the next character in the array.
        // The Lexer : the abstract class LpgLexStream with an implementation of the abstract
        // method getKind.  The template defines the Lexer class and the lexer() method.
        // A driver creates the action class, "Lexer", passing an Option object to the constructor.
        //
       kwLexer? :  %kw_lexer_class ;
       public   printTokens : boolean =false;
       private static  readonly   ECLIPSE_TAB_VALUE: number = 4;

        public  getKeywordKinds() : number [] {
            if(!this.kwLexer){
                throw Error("please initilize kwLexer");
            }
            return this.kwLexer.getKeywordKinds();
        }

        /**
         * @deprecated function replaced by {@link %reset(content : string, filename : string)}
         */
        public  initialize(content : string, filename : string) : void
        {
            this.reset(filename,4,content);
        }

        makeToken1(left_token : number,right_token : number, kind : number) : void
        {
            this.lexStream.makeToken(left_token, right_token, kind);
        }

        makeToken( arg0 : number, arg1?: number, arg2? : number) : void
        {
            if(arg1 && arg2){

                this.makeToken1(arg0,arg1,arg2);
                return ;
            }
            let  startOffset  = this.getLeftSpan();
            let   endOffset = this.getRightSpan();
            this.lexStream.makeToken(startOffset, endOffset, arg0);
            if (this.printTokens)  this.printValue(startOffset, endOffset);
        }

        makeComment(kind : number) : void
        {
            let startOffset =  this.getLeftSpan(),
                endOffset =  this.getRightSpan();
            this.lexStream.getIPrsStream()?.makeAdjunct(startOffset, endOffset, kind);
        }

         skipToken() : void
        {
            if (this.printTokens)  this.printValue( this.getLeftSpan(),  this.getRightSpan());
        }

         checkForKeyWord1() : void
        {
            if(!this.kwLexer){
                throw Error("please initilize kwLexer");
            }
            let startOffset =  this.getLeftSpan(),
                endOffset =  this.getRightSpan();
             let   kwKind = this.kwLexer.lexer(startOffset, endOffset);
            this.lexStream.makeToken(startOffset, endOffset, kwKind);
            if ( this.printTokens)  this.printValue(startOffset, endOffset);
        }

        //
        // This flavor of checkForKeyWord is necessary when the default kind
        // (which is returned when the keyword filter doesn't match) is something
        // other than _IDENTIFIER.
        //
         checkForKeyWord(defaultKind? :number) : void
        {
           if(!defaultKind){
              this.checkForKeyWord1();
              return;
           }
            if(!this.kwLexer){
                throw Error("please initilize kwLexer");
            }
            let startOffset =  this.getLeftSpan(),
                endOffset =  this.getRightSpan();
            let    kwKind =  this.kwLexer.lexer(startOffset, endOffset);
            if (kwKind == %_IDENTIFIER)
                kwKind = defaultKind;
            this.lexStream.makeToken(startOffset, endOffset, kwKind);
            if ( this.printTokens)  this.printValue(startOffset, endOffset);
        }

         printValue(startOffset : number, endOffset : number) : void
        {
             let s = this.lexStream.getInputChars().substr(startOffset, endOffset - startOffset + 1);
             console.log(s);
        }

    ./
%End


# This file has been generated by the GAP build system,
# do not edit manually!
GAParch=FAKE-GAP-ARCH
GAP_ABI=64
GAP_HPCGAP=no

GAP_VERSION="4.12dev"
GAP_BUILD_VERSION="4.12dev"
GAP_LIBTOOL_CURRENT=8
GAP_LIBTOOL_AGE=0
GAP_KERNEL_MAJOR_VERSION=8
GAP_KERNEL_MINOR_VERSION=0

GAP_BIN_DIR="/workspace/destdir/share/gap"
GAP_LIB_DIR="/workspace/destdir/share/gap"

GAP="/workspace/destdir/bin/gap"
GAC="/workspace/destdir/share/gap/gac"

GAP_CC="cc "
GAP_CXX="c++ -std=gnu++11 "
GAP_CFLAGS="-g -O2"
GAP_CXXFLAGS="-g -O2"
GAP_CPPFLAGS="-I/workspace/destdir/include/gap -DUSE_JULIA_GC=1 -fPIC "
GAP_LDFLAGS="-L/workspace/destdir/lib "
GAP_LIBS="-lgmp"


%Headers
    --
    -- Additional methods for the action class not provided in the template
    --
    /.
        //
        // The Lexer contains an array of characters as the input stream to be parsed.
        // There are methods to retrieve and classify characters.
        // The lexparser "token" is implemented simply as the index of the next character in the array.
        // The Lexer extends the abstract class LpgLexStream with an implementation of the abstract
        // method getKind.  The template defines the Lexer class and the lexer() method.
        // A driver creates the action class, "Lexer", passing an Option object to the constructor.
        //
        $kw_lexer_class *kwLexer= nullptr;
        bool printTokens =false;
          static const int ECLIPSE_TAB_VALUE = 4;

        int*  getKeywordKinds() { return kwLexer->getKeywordKinds(); }

        /**
         * @deprecated function replaced by {@link #reset(char [] content, const std::wstring& filename)}
         */
         void initialize(shared_ptr_wstring content, const std::wstring& filename)
        {
            reset(content, filename);
        }

         void makeToken(int left_token, int right_token, int kind)
        {
            lexStream->makeToken(left_token, right_token, kind);
        }

         void makeToken(int kind)
        {
            int startOffset = getLeftSpan(),
                endOffset = getRightSpan();
            lexStream->makeToken(startOffset, endOffset, kind);
            if (printTokens) printValue(startOffset, endOffset);
        }

         void makeComment(int kind)
        {
            int startOffset = getLeftSpan(),
                endOffset = getRightSpan();
            lexStream->getIPrsStream()->makeAdjunct(startOffset, endOffset, kind);
        }

         void skipToken()
        {
            if (printTokens) printValue(getLeftSpan(), getRightSpan());
        }

         void checkForKeyWord()
        {
            int startOffset = getLeftSpan(),
                endOffset = getRightSpan(),
                kwKind = kwLexer->lexer(startOffset, endOffset);
            lexStream->makeToken(startOffset, endOffset, kwKind);
            if (printTokens) printValue(startOffset, endOffset);
        }

        //
        // This flavor of checkForKeyWord is necessary when the default kind
        // (which is returned when the keyword filter doesn't match) is something
        // other than _IDENTIFIER.
        //
         void checkForKeyWord(int defaultKind)
        {
            int startOffset = getLeftSpan(),
                endOffset = getRightSpan(),
                kwKind = kwLexer->lexer(startOffset, endOffset);
            if (kwKind == $_IDENTIFIER)
                kwKind = defaultKind;
            lexStream->makeToken(startOffset, endOffset, kwKind);
            if (printTokens) printValue(startOffset, endOffset);
        }

         void printValue(int startOffset, int endOffset)
        {
           auto  input = lexStream->getInputChars().data();
            std::wstring s(input + startOffset,input + startOffset+  endOffset - startOffset + 1);
            std::wcout << (s) << std::endl ;
        }

        //
        //
        //
         struct $super_stream_class :public LpgLexStream
        {
         inline static int tokenKind[] =
        {
            $sym_type::$prefix$CtlCharNotWS$suffix$,    // 000    0x00
            $sym_type::$prefix$CtlCharNotWS$suffix$,    // 001    0x01
            $sym_type::$prefix$CtlCharNotWS$suffix$,    // 002    0x02
            $sym_type::$prefix$CtlCharNotWS$suffix$,    // 003    0x03
            $sym_type::$prefix$CtlCharNotWS$suffix$,    // 004    0x04
            $sym_type::$prefix$CtlCharNotWS$suffix$,    // 005    0x05
            $sym_type::$prefix$CtlCharNotWS$suffix$,    // 006    0x06
            $sym_type::$prefix$CtlCharNotWS$suffix$,    // 007    0x07
            $sym_type::$prefix$CtlCharNotWS$suffix$,    // 008    0x08
            $sym_type::$prefix$HT$suffix$,              // 009    0x09
            $sym_type::$prefix$LF$suffix$,              // 010    0x0A
            $sym_type::$prefix$CtlCharNotWS$suffix$,    // 011    0x0B
            $sym_type::$prefix$FF$suffix$,              // 012    0x0C
            $sym_type::$prefix$CR$suffix$,              // 013    0x0D
            $sym_type::$prefix$CtlCharNotWS$suffix$,    // 014    0x0E
            $sym_type::$prefix$CtlCharNotWS$suffix$,    // 015    0x0F
            $sym_type::$prefix$CtlCharNotWS$suffix$,    // 016    0x10
            $sym_type::$prefix$CtlCharNotWS$suffix$,    // 017    0x11
            $sym_type::$prefix$CtlCharNotWS$suffix$,    // 018    0x12
            $sym_type::$prefix$CtlCharNotWS$suffix$,    // 019    0x13
            $sym_type::$prefix$CtlCharNotWS$suffix$,    // 020    0x14
            $sym_type::$prefix$CtlCharNotWS$suffix$,    // 021    0x15
            $sym_type::$prefix$CtlCharNotWS$suffix$,    // 022    0x16
            $sym_type::$prefix$CtlCharNotWS$suffix$,    // 023    0x17
            $sym_type::$prefix$CtlCharNotWS$suffix$,    // 024    0x18
            $sym_type::$prefix$CtlCharNotWS$suffix$,    // 025    0x19
            $sym_type::$prefix$CtlCharNotWS$suffix$,    // 026    0x1A
            $sym_type::$prefix$CtlCharNotWS$suffix$,    // 027    0x1B
            $sym_type::$prefix$CtlCharNotWS$suffix$,    // 028    0x1C
            $sym_type::$prefix$CtlCharNotWS$suffix$,    // 029    0x1D
            $sym_type::$prefix$CtlCharNotWS$suffix$,    // 030    0x1E
            $sym_type::$prefix$CtlCharNotWS$suffix$,    // 031    0x1F
            $sym_type::$prefix$Space$suffix$,           // 032    0x20
            $sym_type::$prefix$Exclamation$suffix$,     // 033    0x21
            $sym_type::$prefix$DoubleQuote$suffix$,     // 034    0x22
            $sym_type::$prefix$Sharp$suffix$,           // 035    0x23
            $sym_type::$prefix$DollarSign$suffix$,      // 036    0x24
            $sym_type::$prefix$Percent$suffix$,         // 037    0x25
            $sym_type::$prefix$Ampersand$suffix$,       // 038    0x26
            $sym_type::$prefix$SingleQuote$suffix$,     // 039    0x27
            $sym_type::$prefix$LeftParen$suffix$,       // 040    0x28
            $sym_type::$prefix$RightParen$suffix$,      // 041    0x29
            $sym_type::$prefix$Star$suffix$,            // 042    0x2A
            $sym_type::$prefix$Plus$suffix$,            // 043    0x2B
            $sym_type::$prefix$Comma$suffix$,           // 044    0x2C
            $sym_type::$prefix$Minus$suffix$,           // 045    0x2D
            $sym_type::$prefix$Dot$suffix$,             // 046    0x2E
            $sym_type::$prefix$Slash$suffix$,           // 047    0x2F
            $sym_type::$prefix$0$suffix$,               // 048    0x30
            $sym_type::$prefix$1$suffix$,               // 049    0x31
            $sym_type::$prefix$2$suffix$,               // 050    0x32
            $sym_type::$prefix$3$suffix$,               // 051    0x33
            $sym_type::$prefix$4$suffix$,               // 052    0x34
            $sym_type::$prefix$5$suffix$,               // 053    0x35
            $sym_type::$prefix$6$suffix$,               // 054    0x36
            $sym_type::$prefix$7$suffix$,               // 055    0x37
            $sym_type::$prefix$8$suffix$,               // 056    0x38
            $sym_type::$prefix$9$suffix$,               // 057    0x39
            $sym_type::$prefix$Colon$suffix$,           // 058    0x3A
            $sym_type::$prefix$SemiColon$suffix$,       // 059    0x3B
            $sym_type::$prefix$LessThan$suffix$,        // 060    0x3C
            $sym_type::$prefix$Equal$suffix$,           // 061    0x3D
            $sym_type::$prefix$GreaterThan$suffix$,     // 062    0x3E
            $sym_type::$prefix$QuestionMark$suffix$,    // 063    0x3F
            $sym_type::$prefix$AtSign$suffix$,          // 064    0x40
            $sym_type::$prefix$A$suffix$,               // 065    0x41
            $sym_type::$prefix$B$suffix$,               // 066    0x42
            $sym_type::$prefix$C$suffix$,               // 067    0x43
            $sym_type::$prefix$D$suffix$,               // 068    0x44
            $sym_type::$prefix$E$suffix$,               // 069    0x45
            $sym_type::$prefix$F$suffix$,               // 070    0x46
            $sym_type::$prefix$G$suffix$,               // 071    0x47
            $sym_type::$prefix$H$suffix$,               // 072    0x48
            $sym_type::$prefix$I$suffix$,               // 073    0x49
            $sym_type::$prefix$J$suffix$,               // 074    0x4A
            $sym_type::$prefix$K$suffix$,               // 075    0x4B
            $sym_type::$prefix$L$suffix$,               // 076    0x4C
            $sym_type::$prefix$M$suffix$,               // 077    0x4D
            $sym_type::$prefix$N$suffix$,               // 078    0x4E
            $sym_type::$prefix$O$suffix$,               // 079    0x4F
            $sym_type::$prefix$P$suffix$,               // 080    0x50
            $sym_type::$prefix$Q$suffix$,               // 081    0x51
            $sym_type::$prefix$R$suffix$,               // 082    0x52
            $sym_type::$prefix$S$suffix$,               // 083    0x53
            $sym_type::$prefix$T$suffix$,               // 084    0x54
            $sym_type::$prefix$U$suffix$,               // 085    0x55
            $sym_type::$prefix$V$suffix$,               // 086    0x56
            $sym_type::$prefix$W$suffix$,               // 087    0x57
            $sym_type::$prefix$X$suffix$,               // 088    0x58
            $sym_type::$prefix$Y$suffix$,               // 089    0x59
            $sym_type::$prefix$Z$suffix$,               // 090    0x5A
            $sym_type::$prefix$LeftBracket$suffix$,     // 091    0x5B
            $sym_type::$prefix$BackSlash$suffix$,       // 092    0x5C
            $sym_type::$prefix$RightBracket$suffix$,    // 093    0x5D
            $sym_type::$prefix$Caret$suffix$,           // 094    0x5E
            $sym_type::$prefix$_$suffix$,               // 095    0x5F
            $sym_type::$prefix$BackQuote$suffix$,       // 096    0x60
            $sym_type::$prefix$a$suffix$,               // 097    0x61
            $sym_type::$prefix$b$suffix$,               // 098    0x62
            $sym_type::$prefix$c$suffix$,               // 099    0x63
            $sym_type::$prefix$d$suffix$,               // 100    0x64
            $sym_type::$prefix$e$suffix$,               // 101    0x65
            $sym_type::$prefix$f$suffix$,               // 102    0x66
            $sym_type::$prefix$g$suffix$,               // 103    0x67
            $sym_type::$prefix$h$suffix$,               // 104    0x68
            $sym_type::$prefix$i$suffix$,               // 105    0x69
            $sym_type::$prefix$j$suffix$,               // 106    0x6A
            $sym_type::$prefix$k$suffix$,               // 107    0x6B
            $sym_type::$prefix$l$suffix$,               // 108    0x6C
            $sym_type::$prefix$m$suffix$,               // 109    0x6D
            $sym_type::$prefix$n$suffix$,               // 110    0x6E
            $sym_type::$prefix$o$suffix$,               // 111    0x6F
            $sym_type::$prefix$p$suffix$,               // 112    0x70
            $sym_type::$prefix$q$suffix$,               // 113    0x71
            $sym_type::$prefix$r$suffix$,               // 114    0x72
            $sym_type::$prefix$s$suffix$,               // 115    0x73
            $sym_type::$prefix$t$suffix$,               // 116    0x74
            $sym_type::$prefix$u$suffix$,               // 117    0x75
            $sym_type::$prefix$v$suffix$,               // 118    0x76
            $sym_type::$prefix$w$suffix$,               // 119    0x77
            $sym_type::$prefix$x$suffix$,               // 120    0x78
            $sym_type::$prefix$y$suffix$,               // 121    0x79
            $sym_type::$prefix$z$suffix$,               // 122    0x7A
            $sym_type::$prefix$LeftBrace$suffix$,       // 123    0x7B
            $sym_type::$prefix$VerticalBar$suffix$,     // 124    0x7C
            $sym_type::$prefix$RightBrace$suffix$,      // 125    0x7D
            $sym_type::$prefix$Tilde$suffix$,           // 126    0x7E

            $sym_type::$prefix$AfterASCII$suffix$,      // for all chars in range 128..65534
            $sym_type::$prefix$EOF$suffix$              // for '\uffff' or 65535

        };

          int getKind(int i)  // Classify character at ith location
        {
            int c = (i >= getStreamLength() ? 0xffff : getCharValue(i));
            return (c < 128 // ASCII Character
                      ? tokenKind[c]
                      : c == 0xffff
                           ? $sym_type::$prefix$EOF$suffix$
                           : $sym_type::$prefix$AfterASCII$suffix$);
        }

        std::vector<std::wstring> orderedExportedSymbols() { return $exp_type::orderedTerminalSymbols; }

         $super_stream_class(const std::wstring& filename, int tab):LpgLexStream(filename, tab)
        {

        }

         $super_stream_class(shared_ptr_wstring input_chars, const std::wstring& filename, int tab):LpgLexStream(input_chars, filename, tab)
        {

        }

         $super_stream_class(shared_ptr_wstring input_chars, const std::wstring& filename):LpgLexStream(input_chars, filename, 1)
        {

        }
        };
    ./
%End


--/**
-- * <copyright>
-- *
-- * Copyright (c) 2008, 2009 IBM Corporation and others.
-- * All rights reserved.   This program and the accompanying materials
-- * are made available under the terms of the Eclipse Public License v2.0
-- * which accompanies this distribution, and is available at
-- * http://www.eclipse.org/legal/epl-v20.html
-- *
-- * Contributors:
-- *   IBM - Initial API and implementation
-- *   E.D.Willink - Lexer and Parser refactoring to support extensibility and flexible error handling
-- *   Adolfo Sanchez-Barbudo Herrera (Open Canarias) - LPG v 2.0.17 adoption (242153)
-- *   Adolfo Sanchez-Barbudo Herrera (Open Canarias) - Introducing new LPG templates (299396)
-- *
-- * </copyright>
-- */
--
-- The OCL Backtracking KeyWord Lexer, which is nominally identical to the
-- normal KeyWord Lexer, however the extra ERROR_TOKEN symbol makes it difficult
-- to share reliably.
--

%options slr
%options fp=OCLBacktrackingKWLexer,prefix=Char_
%options noserialize
%options package=org.eclipse.ocl.parser.backtracking
%options template=../../lpg/KeywordTemplateF.gi
%options export_terminals=("OCLBacktrackingParsersym.java", "TK_")
%options include_directory="..;../../lpg"

%Import
	OCLKWLexer.gi
%End


--
-- The Java KeyWord Lexer
--
%Options fp=JavaKWLexer,states
%options template=KeywordTemplateF.gi

%Include
    KWLexerMapF.gi
%End

%Export
    abstract
    assert
    boolean
    break
    byte
    case
    catch
    char
    class
    const
    continue
    default
    do
    double
    enum
    else
    extends
    false
    final
    finally
    float
    for
    goto
    if
    implements
    import
    instanceof
    int
    interface
    long
    native
    new
    null
    package
    private
    protected
    public
    return
    short
    static
    strictfp
    super
    switch
    synchronized
    this
    throw
    throws
    transient
    true
    try
    void
    volatile
    while

    BeginAction
    BeginJava
    EndAction
    EndJava
    NoAction
    NullAction
    BadAction
%End

%Terminals
    a    b    c    d    e    f    g    h    i    j    k    l    m
    n    o    p    q    r    s    t    u    v    w    x    y    z
%End

%Start
    KeyWord
%End

%Notice
/.
////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2007 IBM Corporation.
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
// which accompanies this distribution, and is available at
// http://www.eclipse.org/legal/epl-v10.html
//
//Contributors:
//    Philippe Charles (pcharles@us.ibm.com) - initial API and implementation

////////////////////////////////////////////////////////////////////////////////
./
%End
%Globals
    /.
#include "$sym_type.h"
#include "$prs_type.h"
    ./
%End
%Rules

    -- The Goal for the parser is a single Keyword

    KeyWord ::= a b s t r a c t
        /.$BeginAction
            $setResult($_abstract);
          $EndAction
        ./

              | a s s e r t
        /.$BeginAction
            $setResult($_assert);
          $EndAction
        ./

              | b o o l e a n
        /.$BeginAction
            $setResult($_boolean);
          $EndAction
        ./

              | b r e a k
        /.$BeginAction
            $setResult($_break);
          $EndAction
        ./

              | b y t e
        /.$BeginAction
            $setResult($_byte);
          $EndAction
        ./

              | c a s e
        /.$BeginAction
            $setResult($_case);
          $EndAction
        ./

              | c a t c h
        /.$BeginAction
            $setResult($_catch);
          $EndAction
        ./

              | c h a r
        /.$BeginAction
            $setResult($_char);
          $EndAction
        ./

              | c l a s s
        /.$BeginAction
            $setResult($_class);
          $EndAction
        ./

              | c o n s t
        /.$BeginAction
            $setResult($_const);
          $EndAction
        ./

              | c o n t i n u e
        /.$BeginAction
            $setResult($_continue);
          $EndAction
        ./

              | d e f a u l t
        /.$BeginAction
            $setResult($_default);
          $EndAction
        ./

              | d o
        /.$BeginAction
            $setResult($_do);
          $EndAction
        ./

              | d o u b l e
        /.$BeginAction
            $setResult($_double);
          $EndAction
        ./

              | e l s e
        /.$BeginAction
            $setResult($_else);
          $EndAction
        ./

              | e n u m
        /.$BeginAction
            $setResult($_enum);
          $EndAction
        ./

              | e x t e n d s
        /.$BeginAction
            $setResult($_extends);
          $EndAction
        ./

              | f a l s e
        /.$BeginAction
            $setResult($_false);
          $EndAction
        ./

              | f i n a l
        /.$BeginAction
            $setResult($_final);
          $EndAction
        ./

              | f i n a l l y
        /.$BeginAction
            $setResult($_finally);
          $EndAction
        ./

              | f l o a t
        /.$BeginAction
            $setResult($_float);
          $EndAction
        ./

              | f o r
        /.$BeginAction
            $setResult($_for);
          $EndAction
        ./

              | g o t o
        /.$BeginAction
            $setResult($_goto);
          $EndAction
        ./

              | i f
        /.$BeginAction
            $setResult($_if);
          $EndAction
        ./

              | i m p l e m e n t s
        /.$BeginAction
            $setResult($_implements);
          $EndAction
        ./

              | i m p o r t
        /.$BeginAction
            $setResult($_import);
          $EndAction
        ./

              | i n s t a n c e o f
        /.$BeginAction
            $setResult($_instanceof);
          $EndAction
        ./

              | i n t
        /.$BeginAction
            $setResult($_int);
          $EndAction
        ./

              | i n t e r f a c e
        /.$BeginAction
            $setResult($_interface);
          $EndAction
        ./

              | l o n g
        /.$BeginAction
            $setResult($_long);
          $EndAction
        ./

              | n a t i v e
        /.$BeginAction
            $setResult($_native);
          $EndAction
        ./

              | n e w
        /.$BeginAction
            $setResult($_new);
          $EndAction
        ./

              | n u l l
        /.$BeginAction
            $setResult($_null);
          $EndAction
        ./

              | p a c k a g e
        /.$BeginAction
            $setResult($_package);
          $EndAction
        ./

              | p r i v a t e
        /.$BeginAction
            $setResult($_private);
          $EndAction
        ./

              | p r o t e c t e d
        /.$BeginAction
            $setResult($_protected);
          $EndAction
        ./

              | p u b l i c
        /.$BeginAction
            $setResult($_public);
          $EndAction
        ./

              | r e t u r n
        /.$BeginAction
            $setResult($_return);
          $EndAction
        ./

              | s h o r t
        /.$BeginAction
            $setResult($_short);
          $EndAction
        ./

              | s t a t i c
        /.$BeginAction
            $setResult($_static);
          $EndAction
        ./

              | s t r i c t f p
        /.$BeginAction
            $setResult($_strictfp);
          $EndAction
        ./

              | s u p e r
        /.$BeginAction
            $setResult($_super);
          $EndAction
        ./

              | s w i t c h
        /.$BeginAction
            $setResult($_switch);
          $EndAction
        ./

              | s y n c h r o n i z e d
        /.$BeginAction
            $setResult($_synchronized);
          $EndAction
        ./

              | t h i s
        /.$BeginAction
            $setResult($_this);
          $EndAction
        ./

              | t h r o w
        /.$BeginAction
            $setResult($_throw);
          $EndAction
        ./

              | t h r o w s
        /.$BeginAction
            $setResult($_throws);
          $EndAction
        ./

              | t r a n s i e n t
        /.$BeginAction
            $setResult($_transient);
          $EndAction
        ./

              | t r u e
        /.$BeginAction
            $setResult($_true);
          $EndAction
        ./

              | t r y
        /.$BeginAction
            $setResult($_try);
          $EndAction
        ./

              | v o i d
        /.$BeginAction
            $setResult($_void);
          $EndAction
        ./

              | v o l a t i l e
        /.$BeginAction
            $setResult($_volatile);
          $EndAction
        ./

              | w h i l e
        /.$BeginAction
            $setResult($_while);
          $EndAction
        ./

    KeyWord ::= '$' bB eE gG iI nN aA cC tT iI oO nN
        /.$BeginAction
            $setResult($_BeginAction);
          $EndAction
        ./
              | '$' bB eE gG iI nN jJ aA vV aA
        /.$BeginAction
            $setResult($_BeginJava);
          $EndAction
        ./

    KeyWord ::= '$' eE nN dD aA cC tT iI oO nN
        /.$BeginAction
            $setResult($_EndAction);
          $EndAction
        ./
              | '$' eE nN dD jJ aA vV aA
        /.$BeginAction
            $setResult($_EndJava);
          $EndAction
        ./

    KeyWord ::= '$' nN oO aA cC tT iI oO nN
        /.$BeginAction
            $setResult($_NoAction);
          $EndAction
        ./
    KeyWord ::= '$' nN uU lL lL aA cC tT iI oO nN
        /.$BeginAction
            $setResult($_NullAction);
          $EndAction
        ./
    KeyWord ::= '$' bB aA dD aA cC tT iI oO nN
        /.$BeginAction
            $setResult($_BadAction);
          $EndAction
        ./

    aA -> a | A
    bB -> b | B
    cC -> c | C
    dD -> d | D
    eE -> e | E
    gG -> g | G
    iI -> i | I
    jJ -> j | J
    lL -> l | L
    nN -> n | N
    oO -> o | O
    tT -> t | T
    uU -> u | U
    vV -> v | V
%End


while true do
    Print("SPAM\n");
od;


InstallMethod( JupyterRender, "default fallback"
             , [ IsObject ],
function(obj)
    local str;
    str := ViewString(obj);
    RemoveCharacters(str, "\<\>\n");
    return Objectify( JupyterRenderableType
                    , rec( data := rec( text\/plain := str )
                         , metadata := rec( text\/plain := "") ) );
end);

InstallMethod( JupyterRender, "default fallback"
               , [ IsJupyterRenderableRep ],
               IdFunc);

InstallMethod( JupyterRenderableData, "for a JupyterRenderable"
               , [  IsJupyterRenderableRep ]
               , x -> x!.data );

InstallMethod( JupyterRenderableMetadata, "for a JupyterRenderable"
               , [  IsJupyterRenderableRep ]
               , x -> x!.metadata );

InstallMethod( ViewString, "for a JupyterRenderable"
               , [  IsJupyterRenderableRep ]
               , x -> "<jupyter renderable>" );

InstallMethod( JupyterRenderable, "for a record and a record"
               , [ IsObject, IsObject ],
function(data, metadata)
    return Objectify( JupyterRenderableType
                    , rec( data := data, metadata := metadata ) );
end);


--
-- In a parser using this template, the following macro may be redefined:
--
--     %additional_interfaces
--     %ast_class
--
-- B E G I N N I N G   O F   T E M P L A T E   btParserTemplateF
--
%Options programming_Language=typescript,margin=4,backtrack
%Options table,error_maps,scopes
%options prefix=TK_
%options action-block=("*.ts", "/.", "./")
%options ParseTable=ParseTable
%options nt-check

--
-- This template requires that the name of the EOF token be set
-- to EOF_TOKEN to be consistent with LexerTemplateD and LexerTemplateE
--
%EOF
    EOF_TOKEN
%End

%ERROR
    ERROR_TOKEN
%End

%Define

    $Header
    /.
                //
                // Rule %rule_number:  %rule_text
                //
                ./

    $BeginAction
    /.%Header%case %rule_number: {
                   //#line %next_line "%input_file%"./

    $EndAction
    /.            break;
                }./

    $BeginJava
    /.%Header%case %rule_number: {
                    %symbol_declarations
                    //#line %next_line "%input_file%"./

    $EndJava /.%EndAction./

    $NoAction
    /.%Header%case %rule_number:
                    break;./

    $BadAction
    /.%Header%case %rule_number:
                    throw ("No action specified for rule " + %rule_number);./

    $NullAction
    /.%Header%case %rule_number:
                    this.setResult(null);
                    break;./

    $BeginActions
    /.

        public  ruleAction(ruleNumber : number) : void
        {
            switch (ruleNumber)
            {./

    $SplitActions
    /.
                    default:
                        this.ruleAction%rule_number(ruleNumber);
                        break;
                }
                return;
            }

            public  ruleAction%rule_number(ruleNumber  : number) : void
            {
                switch (ruleNumber)
                {
                    //#line %next_line "%input_file%"./

    $EndActions
    /.
                default:
                    break;
            }
            return;
        }./

    $entry_declarations
    /.

        public  parse%entry_name(monitor? : Monitor, error_repair_count : number = 0) : %ast_class | null
        {
            this.btParser.setMonitor(monitor);

            try
            {
                return <%ast_class> this.btParser.fuzzyParseEntry(%sym_type.%entry_marker, error_repair_count);
            }
            catch (ex)
            {
                if( ex instanceof BadParseException ){
                    let e = <BadParseException>(ex);

                    this.prsStream.reset(e.error_token); // point to error token
                    let diagnoseParser = new DiagnoseParser(this.prsStream, %action_type.prsTable);
                    diagnoseParser.diagnoseEntry(%sym_type.%entry_marker, e.error_token);
                }
                else{
                    throw ex;
                }
            }

            return null;
        }
    ./

    --
    -- Macros that may be needed in a parser using this template
    --
    $additional_interfaces /../
    $ast_class /.%ast_type./
    $super_class /.Object./
    $unimplemented_symbols_warning /.false./

    --
    -- Old deprecated macros that should NEVER be used.
    --
    $setSym1 /. // macro setSym1 is deprecated. Use function setResult
                this.getParser().setSym1./
    $setResult /. // macro setResult is deprecated. Use function setResult
                 this.getParser().setSym1./
    $getSym /. // macro getSym is deprecated. Use function getRhsSym
              this.getParser().getSym./
    $getToken /. // macro getToken is deprecated. Use function getRhsTokenIndex
                this.getParser().getToken./
    $getIToken /. // macro getIToken is deprecated. Use function getRhsIToken
                 this.prsStream.getIToken./
    $getLeftSpan /. // macro getLeftSpan is deprecated. Use function getLeftSpan
                   this.getParser().getFirstToken./
    $getRightSpan /. // macro getRightSpan is deprecated. Use function getRightSpan
                    this.getParser().getLastToken./
%End

%Globals
    /.
import {BadParseException, RuleAction, PrsStream, ParseTable, BacktrackingParser, IToken, ErrorToken, ILexStream, NullExportedSymbolsException,
UnimplementedTerminalsException, Lpg, UndefinedEofSymbolException, NotBacktrackParseTableException, BadParseSymFileException,
IPrsStream, Monitor, DiagnoseParser, IAst, IAstVisitor, IAbstractArrayList, NotDeterministicParseTableException,
 DeterministicParser, NullTerminalSymbolsException } from "lpg2ts";
import { %prs_type } from ".\/%prs_type";
import { %sym_type } from ".\/%sym_type";
    ./
%End

%Headers
    /.
    export class %action_type extends %super_class implements RuleAction%additional_interfaces
    {
        private  prsStream  : PrsStream = new PrsStream();

        private  unimplementedSymbolsWarning : boolean = %unimplemented_symbols_warning;

        private static  prsTable : ParseTable = new %prs_type();
        public  getParseTable() : ParseTable { return %action_type.prsTable; }

        private  btParser : BacktrackingParser ;
        public  getParser() : BacktrackingParser{ return this.btParser; }

        private  setResult(object1 : any) : void{ this.btParser.setSym1(object1); }
        public  getRhsSym(i : number) : any{ return this.btParser.getSym(i); }

        public  getRhsTokenIndex(i : number) : number{ return this.btParser.getToken(i); }
        public  getRhsIToken(i : number) : IToken { return this.prsStream.getIToken(this.getRhsTokenIndex(i)); }

        public  getRhsFirstTokenIndex(i : number) : number { return this.btParser.getFirstToken(i); }
        public  getRhsFirstIToken(i : number) : IToken{ return this.prsStream.getIToken(this.getRhsFirstTokenIndex(i)); }

        public  getRhsLastTokenIndex(i : number):number { return this.btParser.getLastToken(i); }
        public  getRhsLastIToken(i : number):IToken { return this.prsStream.getIToken(this.getRhsLastTokenIndex(i)); }

        public getLeftSpan() :number { return this.btParser.getFirstToken(); }
        public  getLeftIToken() :IToken { return this.prsStream.getIToken(this.getLeftSpan()); }

        public getRightSpan() : number { return this.btParser.getLastToken(); }
        public  getRightIToken() : IToken { return this.prsStream.getIToken(this.getRightSpan()); }

        public  getRhsErrorTokenIndex(i : number) : number
        {
            let index = this.btParser.getToken(i);
            let err = this.prsStream.getIToken(index);
            return (err instanceof ErrorToken ? index : 0);
        }
        public  getRhsErrorIToken(i : number) : ErrorToken
        {
            let index = this.btParser.getToken(i);
            let err = this.prsStream.getIToken(index);
            return <ErrorToken> (err instanceof ErrorToken ? err : null);
        }

        public  reset(lexStream : ILexStream) : void
        {
            this.prsStream.resetLexStream(lexStream);
            this.btParser.reset(this.prsStream);

            try
            {
                this.prsStream.remapTerminalSymbols(this.orderedTerminalSymbols(), %action_type.prsTable.getEoftSymbol());
            }
            catch (e)
            {
                if( e instanceof NullExportedSymbolsException){

                }
                else if( e instanceof UnimplementedTerminalsException){
                    if (this.unimplementedSymbolsWarning) {
                        let unimplemented_symbols = e.getSymbols();
                        Lpg.Lang.System.Out.println("The Lexer will not scan the following token(s):");
                        for (let i : number = 0; i < unimplemented_symbols.size(); i++)
                        {
                            let id = <number>unimplemented_symbols.get(i);
                            Lpg.Lang.System.Out.println("    " + %sym_type.orderedTerminalSymbols[id]);
                        }
                        Lpg.Lang.System.Out.println();
                    }
                }
                else if( e instanceof UndefinedEofSymbolException){
                    throw  (new UndefinedEofSymbolException
                        ("The Lexer does not implement the Eof symbol " +
                        %sym_type.orderedTerminalSymbols[%action_type.prsTable.getEoftSymbol()]));
                }

            }
        }

        constructor(lexStream? :ILexStream)
        {
            super();
            try
            {
                this.btParser = new BacktrackingParser(null, %action_type.prsTable, <RuleAction> this);
            }
            catch (e)
            {
                if(e instanceof NotBacktrackParseTableException)
                throw (new NotBacktrackParseTableException
                                    ("Regenerate %prs_type.ts with -BACKTRACK option"));
                else if(e instanceof BadParseSymFileException){
                    throw (new BadParseSymFileException("Bad Parser Symbol File -- %sym_type.ts"));
                }
                else{
                    throw e;
                }
            }
            if(lexStream){
              this.reset(lexStream);
            }
        }

        public  numTokenKinds() :number { return %sym_type.numTokenKinds; }
        public  orderedTerminalSymbols()  : string[] { return %sym_type.orderedTerminalSymbols; }
        public  getTokenKindName(kind : number ) : string { return %sym_type.orderedTerminalSymbols[kind]; }
        public  getEOFTokenKind() : number{ return %action_type.prsTable.getEoftSymbol(); }
        public  getIPrsStream()  : IPrsStream{ return this.prsStream; }

        /**
         * @deprecated replaced by {@link #getIPrsStream()}
         *
         */
        public  getPrsStream()  : PrsStream{ return this.prsStream; }

        /**
         * @deprecated replaced by {@link #getIPrsStream()}
         *
         */
        public  getParseStream() : PrsStream { return this.prsStream; }

        public parser(error_repair_count : number = 0 ,  monitor? : Monitor) :  %ast_class | null
        {
            this.btParser.setMonitor(monitor);

            try
            {
                return <%ast_class> this.btParser.fuzzyParse(error_repair_count);
            }
            catch (ex)
            {
               if( ex instanceof BadParseException ){
                     let e = <BadParseException>(ex);
                    this.prsStream.reset(e.error_token); // point to error token

                    let diagnoseParser = new DiagnoseParser(this.prsStream, %action_type.prsTable);
                    diagnoseParser.diagnose(e.error_token);
                }
                else{
                    throw ex;
                }
            }

            return null;
        }

        //
        // Additional entry points, if any
        //
        %entry_declarations
    ./

%End

%Rules
    /.%BeginActions./
%End

%Trailers
    /.
        %EndActions
    }
    ./
%End

--
-- E N D   O F   T E M P L A T E
--


# This file has been generated by the GAP build system,
# do not edit manually!
GAParch=FAKE-GAP-ARCH
GAP_ABI=64
GAP_HPCGAP=no

GAP_VERSION="4.12dev"
GAP_BUILD_VERSION="4.12dev"
GAP_LIBTOOL_CURRENT=8
GAP_LIBTOOL_AGE=0
GAP_KERNEL_MAJOR_VERSION=8
GAP_KERNEL_MINOR_VERSION=0

GAP_BIN_DIR="/workspace/destdir/share/gap"
GAP_LIB_DIR="/workspace/destdir/share/gap"

GAP="/workspace/destdir/bin/gap"
GAC="/workspace/destdir/share/gap/gac"

GAP_CC="cc "
GAP_CXX="c++ -std=gnu++11 "
GAP_CFLAGS="-g -O2"
GAP_CXXFLAGS="-g -O2"
GAP_CPPFLAGS="-I/workspace/destdir/include/gap -DHAVE_CONFIG_H -fPIC "
GAP_LDFLAGS="-L/workspace/destdir/lib "
GAP_LIBS="-lgmp"

GAP_OBJS="build/obj/src/ariths.c.lo build/obj/src/bags.c.lo build/obj/src/blister.c.lo build/obj/src/bool.c.lo build/obj/src/calls.c.lo build/obj/src/code.c.lo build/obj/src/collectors.cc.lo build/obj/src/compiler.c.lo build/obj/src/costab.c.lo build/obj/src/cyclotom.c.lo build/obj/src/debug.c.lo build/obj/src/dt.c.lo build/obj/src/dteval.c.lo build/obj/src/error.c.lo build/obj/src/exprs.c.lo build/obj/src/ffdata.c.lo build/obj/src/finfield.c.lo build/obj/src/funcs.c.lo build/obj/src/gap.c.lo build/obj/src/gaptime.c.lo build/obj/build/gap_version.c.lo build/obj/src/gvars.c.lo build/obj/src/hookintrprtr.c.lo build/obj/src/info.c.lo build/obj/src/integer.c.lo build/obj/src/intfuncs.c.lo build/obj/src/intrprtr.c.lo build/obj/src/io.c.lo build/obj/src/iostream.c.lo build/obj/src/libgap-api.c.lo build/obj/src/listfunc.c.lo build/obj/src/listoper.c.lo build/obj/src/lists.c.lo build/obj/src/macfloat.c.lo build/obj/src/modules_builtin.c.lo build/obj/src/modules.c.lo build/obj/src/objcftl.c.lo build/obj/src/objects.c.lo build/obj/src/objfgelm.cc.lo build/obj/src/objpcgel.cc.lo build/obj/src/objset.c.lo build/obj/src/opers.cc.lo build/obj/src/permutat.cc.lo build/obj/src/plist.c.lo build/obj/src/pperm.cc.lo build/obj/src/precord.c.lo build/obj/src/profile.c.lo build/obj/src/range.c.lo build/obj/src/rational.c.lo build/obj/src/read.c.lo build/obj/src/records.c.lo build/obj/src/saveload.c.lo build/obj/src/scanner.c.lo build/obj/src/sctable.c.lo build/obj/src/set.c.lo build/obj/src/stats.c.lo build/obj/src/streams.c.lo build/obj/src/stringobj.c.lo build/obj/src/syntaxtree.c.lo build/obj/src/sysfiles.c.lo build/obj/src/sysroots.c.lo build/obj/src/sysstr.c.lo build/obj/src/system.c.lo build/obj/src/tietze.c.lo build/obj/src/tracing.c.lo build/obj/src/trans.cc.lo build/obj/src/trycatch.c.lo build/obj/src/vars.c.lo build/obj/src/vec8bit.c.lo build/obj/src/vecffe.c.lo build/obj/src/vecgf2.c.lo build/obj/src/vector.c.lo build/obj/src/weakptr.c.lo build/obj/src/julia_gc.c.lo build/obj/src/c_oper1.c.lo build/obj/src/c_type1.c.lo build/obj/src/compstat.c.lo"

JULIA=""
JULIA_CPPFLAGS="-I/workspace/destdir/include/julia -fPIC"
JULIA_LDFLAGS="-L/workspace/destdir/lib -L/workspace/destdir/lib/julia"
JULIA_LIBS="-Wl,-rpath,/workspace/destdir/lib -Wl,-rpath,/workspace/destdir/lib/julia -ljulia"


package main

import (
	"net/http"

	"github.com/unrolled/secure" // or "gopkg.in/unrolled/secure.v1"
)

var myHandler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
	w.Write([]byte("hello world"))
})

func main() {
	secureMiddleware := secure.New(secure.Options{
		AllowedHosts:          []string{"example.com", "ssl.example.com"},
		HostsProxyHeaders:     []string{"X-Forwarded-Host"},
		SSLRedirect:           true,
		SSLHost:               "ssl.example.com",
		SSLProxyHeaders:       map[string]string{"X-Forwarded-Proto": "https"},
		STSSeconds:            315360000,
		STSIncludeSubdomains:  true,
		STSPreload:            true,
		FrameDeny:             true,
		ContentTypeNosniff:    true,
		BrowserXssFilter:      true,
		ContentSecurityPolicy: "script-src $NONCE",
		PublicKey:             `pin-sha256="base64+primary=="; pin-sha256="base64+backup=="; max-age=5184000; includeSubdomains; report-uri="https://www.example.com/hpkp-report"`,
		IsDevelopment: false,
	})

	app := secureMiddleware.Handler(myHandler)
	http.ListenAndServe("127.0.0.1:3000", app)
}


method vfClipMan vfClipMan.mLoad <alias=vfClipMan_mLoad>( )
{
//	this->vForm.mCreateWin()
	ustr empus
	str  emps
	ustr ustmp
	uint comp
	comp as this
		comp.AutoLang=1
		comp.Border=$fbrdSizeable
		comp.Bottom=0
		comp.Caption=empus
		comp.Enabled=1
		comp.FormStyle=$fsChild
		comp.Height=521
		comp.HelpTopic=empus
		comp.Hint=empus
		comp.HorzAlign=$alhLeft
		comp.IconName=empus
		comp.Left=0
		comp.Name="fClipMan"
		comp.Right=0
		comp.StartPos=$spDesigned
		comp.Style=emps
		comp.TabOrder=0
		comp.Tag=0
		comp.Top=0
		comp.TopMost=0
		comp.VertAlign=$alvTop
		comp.Visible=1
		comp.Width=610
		comp.WindowState=$wsNormal
		comp.OnPosChanged.Set( this, fClipMan_PosChanged )
		comp.OnCreate.Set( this, fClipMan_Create )
		comp.OnCloseQuery.Set( this, fClipMan_Close )
		comp.OnLanguage.Set( this, fClipMan_Lang )
		comp as this.Tray0
		comp.Owner = this
			comp.AutoLang=1
			comp.Caption=ustmp.fromutf8("progname")
			comp.Image=ustmp.fromutf8("main\\mclip")
			comp.Name="Tray0"
			comp.RBtnPopupMenu=.pmTray
			comp.Tag=0
			comp.Visible=1
			comp.OnMouse.Set( this, fClipMan_TrayMouse )
		comp as this.pmTray
		comp.Owner = this
			comp.AutoLang=1
			comp.Name="pmTray"
			comp.Tag=0
			comp as this.miTrayExit
			comp.Owner = this.pmTray
				comp.AutoCheck=0
				comp.AutoLang=1
				comp.Caption=ustmp.fromutf8("exit")
				comp.Checked=0
				comp.Ellipsis=0
				comp.Enabled=1
				comp.Image=empus
				comp.Name="miTrayExit"
				comp.RadioCheck=0
				comp.Separator=0
				comp.ShortKey=empus
				comp.Tag=0
				comp.Visible=1
				comp.OnClick.Set( this, fClipMan_Exit )
			comp as this.mPref
			comp.Owner = this.pmTray
				comp.AutoCheck=0
				comp.AutoLang=1
				comp.Caption=ustmp.fromutf8("preferences")
				comp.Checked=0
				comp.Ellipsis=1
				comp.Enabled=1
				comp.Image=empus
				comp.Name="mPref"
				comp.RadioCheck=0
				comp.Separator=0
				comp.ShortKey=empus
				comp.Tag=0
				comp.Visible=1
				comp.OnClick.Set( this, fClipMan_Settings )
			comp as this.mAbout
			comp.Owner = this.pmTray
				comp.AutoCheck=0
				comp.AutoLang=1
				comp.Caption=ustmp.fromutf8("about")
				comp.Checked=0
				comp.Ellipsis=1
				comp.Enabled=1
				comp.Image=empus
				comp.Name="mAbout"
				comp.RadioCheck=0
				comp.Separator=0
				comp.ShortKey=empus
				comp.Tag=0
				comp.Visible=1
				comp.OnClick.Set( this, fClipMan_About )
		comp as this.Menu0
		comp.Owner = this
			comp.AutoLang=1
			comp.Name="Menu0"
			comp.Tag=0
			comp as this.MenuItem0
			comp.Owner = this.Menu0
				comp.AutoCheck=0
				comp.AutoLang=1
				comp.Caption=ustmp.fromutf8("tools")
				comp.Checked=0
				comp.Ellipsis=0
				comp.Enabled=1
				comp.Image=empus
				comp.Name="MenuItem0"
				comp.RadioCheck=0
				comp.Separator=0
				comp.ShortKey=empus
				comp.Tag=0
				comp.Visible=1
				comp as this.MenuItem1
				comp.Owner = this.MenuItem0
					comp.AutoCheck=0
					comp.AutoLang=1
					comp.Caption=ustmp.fromutf8("settings")
					comp.Checked=0
					comp.Ellipsis=0
					comp.Enabled=1
					comp.Image=empus
					comp.Name="MenuItem1"
					comp.RadioCheck=0
					comp.Separator=0
					comp.ShortKey=empus
					comp.Tag=0
					comp.Visible=1
					comp.OnClick.Set( this, fClipMan_Settings )
	comp as this
		comp.ClientHeight=476
		comp.ClientWidth=592
		comp.Menu=.Menu0

	return this
}

method vfClipMan vfClipMan.init( )
{
   this.pTypeId = vfClipMan
   return this
}
func init_vfClipMan <entry>()
{
   regcomp( vfClipMan, "vfClipMan", vForm, $vForm_last,
      %{ %{$mLoad,     vfClipMan_mLoad}},
      0->collection )

}


--
-- An instance of this template must have a $Export section and the export_terminals option
--
-- Macros that may be redefined in an instance of this template
--
--     $eof_token
--     $additional_interfaces
--     $super_stream_class -- subclass com.ibm.lpg.LpgLexStream for getKind
--     $prs_stream_class -- use /.PrsStream./ if not subclassing
--     $super_class
--
-- B E G I N N I N G   O F   T E M P L A T E   LexerTemplateF
--
%Options programming_language=csharp,margin=4
%Options table
%options action-block=("*.cs", "/.", "./")
%options ParseTable=LPG2.Runtime.ParseTable
%Options prefix=Char_

--
-- This template requires that the name of the EOF token be set
-- to EOF and that the prefix be "Char_" to be consistent with
-- KeywordTemplateD.
--
%Eof
    EOF
%End

--
-- This template also requires that the name of the parser EOF
-- Token to be exported be set to EOF_TOKEN
--
%Export
    EOF_TOKEN
%End

%Define
    --
    -- Macros that are be needed in an instance of this template
    --
    $eof_token /.$_EOF_TOKEN./

    $additional_interfaces /../
    $super_stream_class /.$file_prefix$LpgLexStream./
    $prs_stream_class /.IPrsStream./
    $super_class /.object./

    $prs_stream /. // macro prs_stream is deprecated. Use function getPrsStream
                  getPrsStream()./
    $setSym1 /. // macro setSym1 is deprecated. Use function setResult
               lexParser.setSym1./
    $setResult /. // macro setResult is deprecated. Use function setResult
                 lexParser.setSym1./
    $getSym /. // macro getSym is deprecated. Use function getLastToken
              lexParser.getSym./
    $getToken /. // macro getToken is deprecated. Use function getToken
                lexParser.getToken./
    $getLeftSpan /. // macro getLeftSpan is deprecated. Use function getLeftSpan
                   lexParser.getFirstToken./
    $getRightSpan /. // macro getRightSpan is deprecated. Use function getRightSpan
                    lexParser.getLastToken./

    --
    -- Macros useful for specifying actions
    --
    $Header
    /.
                //
                // Rule $rule_number:  $rule_text
                //
                ./

    $DefaultAction
    /.$Header$case $rule_number: { ./

    $BeginAction /.$DefaultAction./

    $EndAction
    /.            break;
                }./

    $BeginJava
    /.$BeginAction
                $symbol_declarations./

    $EndJava /.$EndAction./

    $NoAction
    /.$Header$case $rule_number:
                    break; ./

    $BeginActions
    /.
        public void ruleAction(int ruleNumber)
        {
            switch(ruleNumber)
            {./

    $SplitActions
    /.
                    default:
                        ruleAction$rule_number(ruleNumber);
                        break;
                }
                return;
            }

            public void ruleAction$rule_number(int ruleNumber)
            {
                switch (ruleNumber)
                {./

    $EndActions
    /.
                default:
                    break;
            }
            return;
        }./
%End

%Globals
    /.
    using LPG2.Runtime;
    using System;
    ./
%End

%Headers
    /.
    public class $action_type : $super_class , RuleAction$additional_interfaces
    {
        private $super_stream_class lexStream;

        private static ParseTable prs = new $prs_type();
        public ParseTable getParseTable() { return prs; }

        private LexParser lexParser = new LexParser();
        public LexParser getParser() { return lexParser; }

        public int getToken(int i) { return lexParser.getToken(i); }
        public int getRhsFirstTokenIndex(int i) { return lexParser.getFirstToken(i); }
        public int getRhsLastTokenIndex(int i) { return lexParser.getLastToken(i); }

        public int getLeftSpan() { return lexParser.getToken(1); }
        public int getRightSpan() { return lexParser.getLastToken(); }

        public void resetKeywordLexer()
        {
            if (kwLexer == null)
                  this.kwLexer = new $kw_lexer_class(lexStream.getInputChars(), $_IDENTIFIER);
            else this.kwLexer.setInputChars(lexStream.getInputChars());
        }

        public void reset(string filename, int tab)
        {
            lexStream = new $super_stream_class(filename, tab);
            lexParser.reset((ILexStream) lexStream, prs, (RuleAction) this);
            resetKeywordLexer();
        }

        public void reset(char[] input_chars, string filename)
        {
            reset(input_chars, filename, 1);
        }

        public void reset(char[] input_chars, string filename, int tab)
        {
            lexStream = new $super_stream_class(input_chars, filename, tab);
            lexParser.reset((ILexStream) lexStream, prs, (RuleAction) this);
            resetKeywordLexer();
        }

        public $action_type(string filename, int tab)
        {
            reset(filename, tab);
        }

        public $action_type(char[] input_chars, string filename, int tab)
        {
            reset(input_chars, filename, tab);
        }

        public $action_type(char[] input_chars, string filename)
        {
            reset(input_chars, filename, 1);
        }

        public $action_type() {}

        public ILexStream getILexStream() { return lexStream; }

        /**
         * @deprecated replaced by {@link #getILexStream()}
         */
        public ILexStream getLexStream() { return lexStream; }

        private void initializeLexer($prs_stream_class prsStream, int start_offset, int end_offset)
        {
            if (lexStream.getInputChars() == null)
                throw new NullReferenceException("LexStream was not initialized");
            lexStream.setPrsStream(prsStream);
            prsStream.makeToken(start_offset, end_offset, 0); // Token list must start with a bad token
        }

        private void addEOF($prs_stream_class prsStream, int end_offset)
        {
            prsStream.makeToken(end_offset, end_offset, $eof_token); // and end with the end of file token
            prsStream.setStreamLength(prsStream.getSize());
        }

        public void lexer($prs_stream_class prsStream)
        {
            lexer(null, prsStream);
        }

        public void lexer(Monitor monitor, $prs_stream_class prsStream)
        {
            initializeLexer(prsStream, 0, -1);
            lexParser.parseCharacters(monitor);  // Lex the input characters
            addEOF(prsStream, lexStream.getStreamIndex());
        }

        public void lexer($prs_stream_class prsStream, int start_offset, int end_offset)
        {
            lexer(null, prsStream, start_offset, end_offset);
        }

        public void lexer(Monitor monitor, $prs_stream_class prsStream, int start_offset, int end_offset)
        {
            if (start_offset <= 1)
                 initializeLexer(prsStream, 0, -1);
            else initializeLexer(prsStream, start_offset - 1, start_offset - 1);

            lexParser.parseCharacters(monitor, start_offset, end_offset);

            addEOF(prsStream, (end_offset >= lexStream.getStreamIndex() ? lexStream.getStreamIndex() : end_offset + 1));
        }

        /**
         * If a parse stream was not passed to this Lexical analyser then we
         * simply report a lexical error. Otherwise, we produce a bad token.
         */
        public void reportLexicalError(int startLoc, int endLoc) {
            IPrsStream prs_stream = lexStream.getIPrsStream();
            if (prs_stream == null)
                lexStream.reportLexicalError(startLoc, endLoc);
            else {
                //
                // Remove any token that may have been processed that fall in the
                // range of the lexical error... then add one error token that spans
                // the error range.
                //
                for (int i = prs_stream.getSize() - 1; i > 0; i--) {
                    if (prs_stream.getStartOffset(i) >= startLoc)
                         prs_stream.removeLastToken();
                    else break;
                }
                prs_stream.makeToken(startLoc, endLoc, 0); // add an error token to the prsStream
            }
        }
    ./
%End

%Rules
    /.$BeginActions./
%End

%Trailers
    /.
        $EndActions
    }
    ./
%End

--
-- E N D   O F   T E M P L A T E
--


InfiniteLoop := function()
	local n;
	n := 1;
	while true do
		Display(n);
		n := n + 1;
	od;
end;

# Prepare some coffee
InfiniteLoop();


%Options fp=LPGKWLexer
%options single-productions
%options template=KeywordTemplateF.gi

%Include
    --
    -- Each upper case letter is mapped into is corresponding
    -- lower case counterpart. For example, if an 'A' appears
    -- in the input, it is mapped into Char_a just like 'a'.
    --
    KWLexerFoldedCaseMapF.gi
%End

%Export
   ALIAS_KEY
   AST_KEY
   DEFINE_KEY
   DISJOINTPREDECESSORSETS_KEY
   DROPRULES_KEY
   DROPSYMBOLS_KEY
   EMPTY_KEY
   END_KEY
   ERROR_KEY
   EOL_KEY
   EOF_KEY
   EXPORT_KEY
   GLOBALS_KEY
   HEADERS_KEY
   IDENTIFIER_KEY
   IMPORT_KEY
   INCLUDE_KEY
   KEYWORDS_KEY
   NAMES_KEY
   NOTICE_KEY
   OPTIONS_KEY
   RECOVER_KEY
   RULES_KEY
   SOFT_KEYWORDS_KEY
   START_KEY
   TERMINALS_KEY
   TRAILERS_KEY
   TYPES_KEY
%End
%Globals
    /.
#pragma once
#include "LPGLexerprs.h"
#include "tuple.h"
#include "LPGKWLexerprs.h"
#include "LPGParsersym.h"
    ./
%End
%Start
    Keyword
%End

%Notice
/.
////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2007 IBM Corporation.
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
// which accompanies this distribution, and is available at
// http://www.eclipse.org/legal/epl-v10.html
//
//Contributors:
//    Philippe Charles (pcharles@us.ibm.com) - initial API and implementation

////////////////////////////////////////////////////////////////////////////////
./
%End

%Rules
    Keyword ::= KeyPrefix a l i a s
        /.$BeginJava
            $setResult($_ALIAS_KEY);
          $EndJava
        ./
    Keyword ::= KeyPrefix a s t
        /.$BeginJava
            $setResult($_AST_KEY);
          $EndJava
        ./
    Keyword ::= KeyPrefix d e f i n e
        /.$BeginJava
            $setResult($_DEFINE_KEY);
          $EndJava
        ./
     Keyword ::= KeyPrefix d i s j o i n t p r e d e c e s s o r s e t s
        /.$BeginJava
            $setResult($_DISJOINTPREDECESSORSETS_KEY);
          $EndJava
        ./
    Keyword ::= KeyPrefix d r o p r u l e s
        /.$BeginJava
            $setResult($_DROPRULES_KEY);
          $EndJava
        ./
    Keyword ::= KeyPrefix d r o p s y m b o l s
        /.$BeginJava
            $setResult($_DROPSYMBOLS_KEY);
          $EndJava
        ./
    Keyword ::= KeyPrefix e m p t y
        /.$BeginJava
            $setResult($_EMPTY_KEY);
          $EndJava
        ./
    Keyword ::= KeyPrefix e n d
        /.$BeginJava
            $setResult($_END_KEY);
          $EndJava
        ./
    Keyword ::= KeyPrefix e r r o r
        /.$BeginJava
            $setResult($_ERROR_KEY);
          $EndJava
        ./
    Keyword ::= KeyPrefix e o l
        /.$BeginJava
            $setResult($_EOL_KEY);
          $EndJava
        ./
    Keyword ::= KeyPrefix e o f
        /.$BeginJava
            $setResult($_EOF_KEY);
          $EndJava
        ./
    Keyword ::= KeyPrefix e x p o r t
        /.$BeginJava
            $setResult($_EXPORT_KEY);
          $EndJava
        ./
    Keyword ::= KeyPrefix g l o b a l s
        /.$BeginJava
            $setResult($_GLOBALS_KEY);
          $EndJava
        ./
    Keyword ::= KeyPrefix h e a d e r s
        /.$BeginJava
            $setResult($_HEADERS_KEY);
          $EndJava
        ./
    Keyword ::= KeyPrefix i d e n t i f i e r
        /.$BeginJava
            $setResult($_IDENTIFIER_KEY);
          $EndJava
        ./
    Keyword ::= KeyPrefix i m p o r t
        /.$BeginJava
            $setResult($_IMPORT_KEY);
          $EndJava
        ./
    Keyword ::= KeyPrefix i n c l u d e
        /.$BeginJava
            $setResult($_INCLUDE_KEY);
          $EndJava
        ./
    Keyword ::= KeyPrefix k e y w o r d s
        /.$BeginJava
            $setResult($_KEYWORDS_KEY);
          $EndJava
        ./
    Keyword ::= KeyPrefix s o f t k e y w o r d s
        /.$BeginJava
            $setResult($_SOFT_KEYWORDS_KEY);
          $EndJava
        ./
    Keyword ::= KeyPrefix n a m e s
        /.$BeginJava
            $setResult($_NAMES_KEY);
          $EndJava
        ./
    Keyword ::= KeyPrefix n o t i c e
        /.$BeginJava
            $setResult($_NOTICE_KEY);
          $EndJava
        ./
    Keyword ::= KeyPrefix t e r m i n a l s
        /.$BeginJava
            $setResult($_TERMINALS_KEY);
          $EndJava
        ./
    Keyword ::= KeyPrefix r e c o v e r
        /.$BeginJava
            $setResult($_RECOVER_KEY);
          $EndJava
        ./
    Keyword ::= KeyPrefix r u l e s
        /.$BeginJava
            $setResult($_RULES_KEY);
          $EndJava
        ./
    Keyword ::= KeyPrefix s t a r t
        /.$BeginJava
            $setResult($_START_KEY);
          $EndJava
        ./
    Keyword ::= KeyPrefix t r a i l e r s
        /.$BeginJava
            $setResult($_TRAILERS_KEY);
          $EndJava
        ./
    Keyword ::= KeyPrefix t y p e s
        /.$BeginJava
            $setResult($_TYPES_KEY);
          $EndJava
        ./

    KeyPrefix -> '$' | '%'
%End


--
-- An instance of this template must have a $Export section and the export_terminals option
--
-- Macros that may be redefined in an instance of this template
--
--     $eof_token
--     $additional_interfaces
--     $super_stream_class -- subclass com.ibm.lpg.LpgLexStream for getKind
--     $prs_stream_class -- use /.PrsStream./ if not subclassing
--
-- B E G I N N I N G   O F   T E M P L A T E   LexerTemplateD
--
%options programming_language=java,margin=4
%options table
%options action-block=("*.java", "/.", "./")
%options ParseTable=lpg.runtime.ParseTable
%options prefix=Char_

--
-- This template requires that the name of the EOF token be set
-- to EOF and that the prefix be "Char_" to be consistent with
-- KeywordTemplateD.
--
%Eof
    EOF
%End

--
-- This template also requires that the name of the parser EOF
-- Token to be exported be set to EOF_TOKEN
--
%Export
    EOF_TOKEN
%End

%Define
    --
    -- Macros that are be needed in an instance of this template
    --
    $eof_token /.$_EOF_TOKEN./

    $additional_interfaces /../
    $super_stream_class /.AbstractLexer./
    $prs_stream_class /.AbstractParser./
    $environment_class /.BasicEnvironment./
    $adapt_environment /.environment./

    $prs_stream /. // macro prs_stream is deprecated. Use function getPrsStream
                  getPrsStream()./
    $setSym1 /. // macro setSym1 is deprecated. Use function setResult
               lexParser.setSym1./
    $setResult /. // macro setResult is deprecated. Use function setResult
                 lexParser.setSym1./
    $getSym /. // macro getSym is deprecated. Use function getLastToken
              lexParser.getSym./
    $getToken /. // macro getToken is deprecated. Use function getToken
                lexParser.getToken./
    $getLeftSpan /. // macro getLeftSpan is deprecated. Use function getLeftSpan
                   lexParser.getFirstToken./
    $getRightSpan /. // macro getRightSpan is deprecated. Use function getRightSpan
                    lexParser.getLastToken./

    --
    -- Macros useful for specifying actions
    --
    $Header
    /.
                //
                // Rule $rule_number:  $rule_text
                //./

    $DefaultAction
    /. $Header
                case $rule_number: { ./

    $BeginAction /.$DefaultAction./

    $EndAction
    /.          break;
                }./

    $BeginJava
    /.$BeginAction
                $symbol_declarations./

    $EndJava /.$EndAction./

    $NoAction
    /. $Header
                case $rule_number:
                    break; ./

    $BeginActions
    /.
        public void ruleAction( int ruleNumber)
        {
            switch(ruleNumber)
            {./

    $SplitActions
    /.
	            default:
	                ruleAction$rule_number(ruleNumber);
	                break;
	        }
	        return;
	    }

	    public void ruleAction$rule_number(int ruleNumber)
	    {
	        switch (ruleNumber)
	        {./

    $EndActions
    /.
                default:
                    break;
            }
            return;
        }./
%End

%Globals
    /.import lpg.runtime.*;
    import org.eclipse.ocl.lpg.AbstractLexer;
    import org.eclipse.ocl.lpg.AbstractParser;
    ./
%End

%Headers
    /.
    @SuppressWarnings("nls")
    public class $action_type extends $super_stream_class implements $exp_type, $sym_type, RuleAction$additional_interfaces
    {
        private static ParseTable prs = new $prs_type();
        //
        // The Lexer contains an array of characters as the input stream to be parsed.
        // There are methods to retrieve and classify characters.
        // The lexparser "token" is implemented simply as the index of the next character in the array.
        // The Lexer extends the abstract class LpgLexStream with an implementation of the abstract
        // method getKind.  The template defines the Lexer class and the lexer() method.
        // A driver creates the action class, "Lexer", passing an Option object to the constructor.
        //
        protected $kw_lexer_class kwLexer;
        protected boolean printTokens;
        private $prs_stream_class parser;
        private LexParser lexParser = new LexParser(this, prs, this);

        private final $environment_class oclEnvironment;

        public $action_type($environment_class environment) {
            super($adapt_environment);
            oclEnvironment = environment;
        }

		public $action_class($environment_class environment, char[] chars) {
			this(environment, chars, "OCL", ECLIPSE_TAB_VALUE);
			kwLexer = new $kw_lexer_class(getInputChars(), $_IDENTIFIER);
		}

        public $action_type($environment_class environment, char[] input_chars, String filename, int tab)  {
            super($adapt_environment, input_chars, filename, tab);
            oclEnvironment = environment;
        }

		public $environment_class getOCLEnvironment() {
        	return oclEnvironment;
        }

        @Override
        public int [] getKeywordKinds() { return kwLexer.getKeywordKinds(); }

        public int getLeftSpan() { return lexParser.getFirstToken(); }
        public $prs_stream_class getParser() { return parser; }
        public int getRhsFirstTokenIndex(int i) { return lexParser.getFirstToken(i); }
        public int getRhsLastTokenIndex(int i) { return lexParser.getLastToken(i); }
        public int getRightSpan() { return lexParser.getLastToken(); }

        @Override
        public int getToken(int i) { return lexParser.getToken(i); }

        @Override
        public void initialize(char [] content, String filename)
        {
            super.initialize(content, filename);
            if (kwLexer == null)
                 kwLexer = new $kw_lexer_class(getInputChars(), $_IDENTIFIER);
            else
                 kwLexer.setInputChars(getInputChars());
        }

        @Override
        public String[] orderedExportedSymbols() { return $exp_type.orderedTerminalSymbols; }

	    @Override
	    public void setInputChars(char[] inputChars) {
			super.setInputChars(inputChars);
			kwLexer = new $kw_lexer_class(getInputChars(), $_IDENTIFIER);
		}

        @Override
        public void lexToTokens(Monitor monitor, $prs_stream_class parser)
        {
            if (getInputChars() == null)
                throw new NullPointerException("LexStream was not initialized");

            this.parser = parser;

            parser.makeToken(0, 0, 0); // Token list must start with a bad token

            lexParser.parseCharacters(monitor);  // Lex the input characters

            int i = getStreamIndex();
            parser.makeToken(i, i, $eof_token); // and end with the end of file token
            parser.setStreamLength(parser.getSize());

            return;
        }
    ./
%End

%Rules
    /.$BeginActions./
%End

%Trailers
    /.
        $EndActions
    }
    ./
%End

--
-- E N D   O F   T E M P L A T E
--