
// PACKAGE GENTLY  -  GENTLE RUNTIME LIBRARY
// COPYRIGHT (C) 2000-2013 COMPILERTOOLS.NET
// ALL RIGHTS RESERVED.   MAY BE DISTRIBUTED
// AS PART OF SOFTWARE GENERATED WITH GENTLE

package Gently;_x000D_
_x000D_
public class SemanticActions_x000D_
{_x000D_
   public static void TraceAction()_x000D_
   {_x000D_
   }_x000D_
_x000D_
   // === Parser Actions ===_x000D_
_x000D_
   // ...................................................................._x000D_
   // called in semantic actions of parser :_x000D_
   // SourceRange //1_x000D_
   // SourceRangeEmpty //2_x000D_
   // ...................................................................._x000D_
_x000D_
   // Source Range_x000D_
   // ------------_x000D_
   // called in semantic action of generated parser_x000D_
   // m : m1 ... mn {_x000D_
   // x = Node (...);_x000D_
   // SourceRange($1, $n, x);_x000D_
   // $$ = x;_x000D_
   // }_x000D_
   static LexerState Voriger = null;_x000D_
_x000D_
   public static void SourceRange(JavaNode x1, JavaNode x2, JavaNode x,_x000D_
         LexerState PEgon, int Folding)_x000D_
   // 1_x000D_
   {_x000D_
_x000D_
      int line1 = x1.getCoordinate().getLine();_x000D_
      int offset1 = x1.getCoordinate().getOffset();_x000D_
      int length1 = x1.getCoordinate().getLength();_x000D_
      int offset2 = x2.getCoordinate().getOffset();_x000D_
      int length2 = x2.getCoordinate().getLength();_x000D_
_x000D_
      int line = line1;_x000D_
      int offset = offset1;_x000D_
      int length = offset2 + length2 - offset1;_x000D_
_x000D_
      if (Voriger == null)_x000D_
         Voriger = PEgon;_x000D_
_x000D_
      x.setCoordinate(new Coordinate(TokenStream.CurrentFile, line, offset,_x000D_
            length));_x000D_
_x000D_
      x.SetChildPositions();_x000D_
_x000D_
      if (x.folding != 1)_x000D_
         x.folding = Folding;_x000D_
_x000D_
      Voriger = PEgon;_x000D_
   }_x000D_
_x000D_
   // SourceRangeEmpty_x000D_
   // ----------------_x000D_
   // called in semantic action of generated parser_x000D_
   // see SourceRange_x000D_
   // used for empty rhs_x000D_
   public static void SourceRangeEmpty(JavaNode x, LexerState PEgon)_x000D_
   {_x000D_
      x.setCoordinate(new Coordinate(TokenStream.CurrentFile, PEgon.SourceLine,_x000D_
            PEgon.SourceOffset, 0 // length_x000D_
      ));_x000D_
_x000D_
   }_x000D_
_x000D_
   // === Lexer Actions ===_x000D_
_x000D_
   // Yywhitespace_x000D_
   // ------------_x000D_
   // called in semantic action of generated lexer rules for whitespace_x000D_
   // e.g._x000D_
   // " " {_x000D_
   // Yywhitespace(yytext);_x000D_
   // }_x000D_
   public static void Yywhitespace(String str, LexerState LEgon)_x000D_
   {_x000D_
      final int len = str.length();_x000D_
_x000D_
      CheckForEol(str, LEgon);_x000D_
_x000D_
      JavaStringValue node = new JavaStringValue(str);_x000D_
_x000D_
      // int offset = Egon.SourceOffset-len;_x000D_
      int offset = LEgon.SourceOffset - len;_x000D_
      TokenStream.STARTOFFSET = offset;_x000D_
_x000D_
      node.setCoordinate(new Coordinate( // COORD 1 YyWhitespace (Lexer)_x000D_
            TokenStream.CurrentFile, LEgon.SourceLine, offset, len));_x000D_
_x000D_
      LEgon.yylval = node;_x000D_
      LexerState.LEXERSTATE_yylval = node;_x000D_
_x000D_
   }_x000D_
_x000D_
   // Yyunmatched_x000D_
   // -----------_x000D_
   // called in semantic action of generated lexer rule_x000D_
   // for unmatched input_x000D_
   // e.g._x000D_
   // . {_x000D_
   // Yyunmatched(yytext);_x000D_
   // }_x000D_
   public static void Yyunmatched(String str, LexerState LEgon)_x000D_
   {_x000D_
      final int startoffset = LEgon.SourceOffset;// +1;_x000D_
      final int len = str.length();_x000D_
_x000D_
      TokenStream.STARTOFFSET = startoffset;_x000D_
_x000D_
      CheckForEol(str, LEgon);_x000D_
_x000D_
      JavaStringValue node = new JavaStringValue(str);_x000D_
_x000D_
      int offset = LEgon.SourceOffset - len;_x000D_
      node.setCoordinate(new Coordinate( // COORD 2 Yytext (Lexer)_x000D_
            TokenStream.CurrentFile, LEgon.SourceLine, startoffset, // offset,_x000D_
            len));_x000D_
_x000D_
      LEgon.yylval = node;_x000D_
      LexerState.LEXERSTATE_yylval = node;_x000D_
_x000D_
   }_x000D_
_x000D_
   // Yytext_x000D_
   // ------_x000D_
   // called in semactic actions of lex rules for matched tokens_x000D_
   // e.g._x000D_
   // "abc" {_x000D_
   // yylval = Yytext(yytext);_x000D_
   // return tokencode;_x000D_
   // }_x000D_
   public static JavaNode Yytext(String str, LexerState LEgon)_x000D_
   {_x000D_
_x000D_
      final int startoffset = LEgon.SourceOffset;// +1;_x000D_
      final int len = str.length();_x000D_
_x000D_
      TokenStream.STARTOFFSET = startoffset;_x000D_
_x000D_
      CheckForEol(str, LEgon);_x000D_
_x000D_
      JavaStringValue node = new JavaStringValue(str);_x000D_
_x000D_
      node.setCoordinate(new Coordinate( // COORD 2 Yytext (Lexer)_x000D_
            TokenStream.CurrentFile, LEgon.SourceLine, startoffset, // offset,_x000D_
            len));_x000D_
_x000D_
      LEgon.yylval = node;_x000D_
      LexerState.LEXERSTATE_yylval = node;_x000D_
_x000D_
      return node;_x000D_
   }_x000D_
_x000D_
   // see value converter_x000D_
   public static void AssignYylval(JavaNode node, LexerState Egon)_x000D_
   {_x000D_
      Egon.yylval = node;_x000D_
      LexerState.LEXERSTATE_yylval = node;_x000D_
   }_x000D_
_x000D_
   private static void CheckForEol(String str, LexerState LEgon)_x000D_
   {_x000D_
      final int len = str.length();_x000D_
_x000D_
      for (int i = 0; i < len; i++) {_x000D_
         char ch = str.charAt(i);_x000D_
_x000D_
         LEgon.SourceOffset++; // NEXTCOL 1 YyWhitespace_x000D_
         LexerState.LEXERSTATE_SourceOffset++;_x000D_
_x000D_
         if (ch == '\n') {_x000D_
            LEgon.SourceLine++; // NEXTLINE 1 YyWhitespace_x000D_
            LexerState.LEXERSTATE_SourceLine++;_x000D_
         }_x000D_
      }_x000D_
_x000D_
   }_x000D_
_x000D_
}_x000D_

// see value converter_x000D_

// PACKAGE GENTLY  -  GENTLE RUNTIME LIBRARY
// COPYRIGHT (C) 2000-2013 COMPILERTOOLS.NET
// ALL RIGHTS RESERVED.   MAY BE DISTRIBUTED
// AS PART OF SOFTWARE GENERATED WITH GENTLE

package Gently;_x000D_
_x000D_
public class SemanticActions_x000D_
{_x000D_
   public static void TraceAction()_x000D_
   {_x000D_
   }_x000D_
_x000D_
   // === Parser Actions ===_x000D_
_x000D_
   // ...................................................................._x000D_
   // called in semantic actions of parser :_x000D_
   // SourceRange //1_x000D_
   // SourceRangeEmpty //2_x000D_
   // ...................................................................._x000D_
_x000D_
   // Source Range_x000D_
   // ------------_x000D_
   // called in semantic action of generated parser_x000D_
   // m : m1 ... mn {_x000D_
   // x = Node (...);_x000D_
   // SourceRange($1, $n, x);_x000D_
   // $$ = x;_x000D_
   // }_x000D_
   static LexerState Voriger = null;_x000D_
_x000D_
   public static void SourceRange(JavaNode x1, JavaNode x2, JavaNode x,_x000D_
         LexerState PEgon, int Folding)_x000D_
   // 1_x000D_
   {_x000D_
_x000D_
      int line1 = x1.getCoordinate().getLine();_x000D_
      int offset1 = x1.getCoordinate().getOffset();_x000D_
      int length1 = x1.getCoordinate().getLength();_x000D_
      int offset2 = x2.getCoordinate().getOffset();_x000D_
      int length2 = x2.getCoordinate().getLength();_x000D_
_x000D_
      int line = line1;_x000D_
      int offset = offset1;_x000D_
      int length = offset2 + length2 - offset1;_x000D_
_x000D_
      if (Voriger == null)_x000D_
         Voriger = PEgon;_x000D_
_x000D_
      x.setCoordinate(new Coordinate(TokenStream.CurrentFile, line, offset,_x000D_
            length));_x000D_
_x000D_
      x.SetChildPositions();_x000D_
_x000D_
      if (x.folding != 1)_x000D_
         x.folding = Folding;_x000D_
_x000D_
      Voriger = PEgon;_x000D_
   }_x000D_
_x000D_
   // SourceRangeEmpty_x000D_
   // ----------------_x000D_
   // called in semantic action of generated parser_x000D_
   // see SourceRange_x000D_
   // used for empty rhs_x000D_
   public static void SourceRangeEmpty(JavaNode x, LexerState PEgon)_x000D_
   {_x000D_
      x.setCoordinate(new Coordinate(TokenStream.CurrentFile, PEgon.SourceLine,_x000D_
            PEgon.SourceOffset, 0 // length_x000D_
      ));_x000D_
_x000D_
   }_x000D_
_x000D_
   // === Lexer Actions ===_x000D_
_x000D_
   // Yywhitespace_x000D_
   // ------------_x000D_
   // called in semantic action of generated lexer rules for whitespace_x000D_
   // e.g._x000D_
   // " " {_x000D_
   // Yywhitespace(yytext);_x000D_
   // }_x000D_
   public static void Yywhitespace(String str, LexerState LEgon)_x000D_
   {_x000D_
      final int len = str.length();_x000D_
_x000D_
      CheckForEol(str, LEgon);_x000D_
_x000D_
      JavaStringValue node = new JavaStringValue(str);_x000D_
_x000D_
      // int offset = Egon.SourceOffset-len;_x000D_
      int offset = LEgon.SourceOffset - len;_x000D_
      TokenStream.STARTOFFSET = offset;_x000D_
_x000D_
      node.setCoordinate(new Coordinate( // COORD 1 YyWhitespace (Lexer)_x000D_
            TokenStream.CurrentFile, LEgon.SourceLine, offset, len));_x000D_
_x000D_
      LEgon.yylval = node;_x000D_
      LexerState.LEXERSTATE_yylval = node;_x000D_
_x000D_
   }_x000D_
_x000D_
   // Yyunmatched_x000D_
   // -----------_x000D_
   // called in semantic action of generated lexer rule_x000D_
   // for unmatched input_x000D_
   // e.g._x000D_
   // . {_x000D_
   // Yyunmatched(yytext);_x000D_
   // }_x000D_
   public static void Yyunmatched(String str, LexerState LEgon)_x000D_
   {_x000D_
      final int startoffset = LEgon.SourceOffset;// +1;_x000D_
      final int len = str.length();_x000D_
_x000D_
      TokenStream.STARTOFFSET = startoffset;_x000D_
_x000D_
      CheckForEol(str, LEgon);_x000D_
_x000D_
      JavaStringValue node = new JavaStringValue(str);_x000D_
_x000D_
      int offset = LEgon.SourceOffset - len;_x000D_
      node.setCoordinate(new Coordinate( // COORD 2 Yytext (Lexer)_x000D_
            TokenStream.CurrentFile, LEgon.SourceLine, startoffset, // offset,_x000D_
            len));_x000D_
_x000D_
      LEgon.yylval = node;_x000D_
      LexerState.LEXERSTATE_yylval = node;_x000D_
_x000D_
   }_x000D_
_x000D_
   // Yytext_x000D_
   // ------_x000D_
   // called in semactic actions of lex rules for matched tokens_x000D_
   // e.g._x000D_
   // "abc" {_x000D_
   // yylval = Yytext(yytext);_x000D_
   // return tokencode;_x000D_
   // }_x000D_
   public static JavaNode Yytext(String str, LexerState LEgon)_x000D_
   {_x000D_
_x000D_
      final int startoffset = LEgon.SourceOffset;// +1;_x000D_
      final int len = str.length();_x000D_
_x000D_
      TokenStream.STARTOFFSET = startoffset;_x000D_
_x000D_
      CheckForEol(str, LEgon);_x000D_
_x000D_
      JavaStringValue node = new JavaStringValue(str);_x000D_
_x000D_
      node.setCoordinate(new Coordinate( // COORD 2 Yytext (Lexer)_x000D_
            TokenStream.CurrentFile, LEgon.SourceLine, startoffset, // offset,_x000D_
            len));_x000D_
_x000D_
      LEgon.yylval = node;_x000D_
      LexerState.LEXERSTATE_yylval = node;_x000D_
_x000D_
      return node;_x000D_
   }_x000D_
_x000D_
   // see value<SUF>
   public static void AssignYylval(JavaNode node, LexerState Egon)_x000D_
   {_x000D_
      Egon.yylval = node;_x000D_
      LexerState.LEXERSTATE_yylval = node;_x000D_
   }_x000D_
_x000D_
   private static void CheckForEol(String str, LexerState LEgon)_x000D_
   {_x000D_
      final int len = str.length();_x000D_
_x000D_
      for (int i = 0; i < len; i++) {_x000D_
         char ch = str.charAt(i);_x000D_
_x000D_
         LEgon.SourceOffset++; // NEXTCOL 1 YyWhitespace_x000D_
         LexerState.LEXERSTATE_SourceOffset++;_x000D_
_x000D_
         if (ch == '\n') {_x000D_
            LEgon.SourceLine++; // NEXTLINE 1 YyWhitespace_x000D_
            LexerState.LEXERSTATE_SourceLine++;_x000D_
         }_x000D_
      }_x000D_
_x000D_
   }_x000D_
_x000D_
}_x000D_
