Author: jani
Date: Tue Feb  5 21:27:17 2013
New Revision: 1442758

URL: http://svn.apache.org/viewvc?rev=1442758&view=rev
Log:
update to run in windows and ubuntu

Added:
    openoffice/branches/l10n/main/l10ntools/source/gConHrc.cxx   (with props)
    openoffice/branches/l10n/main/l10ntools/source/gConHrc.hxx   (with props)
    openoffice/branches/l10n/main/l10ntools/source/gConHrcWrap.cxx   (with 
props)
    openoffice/branches/l10n/main/l10ntools/source/gConHrclex.l   (with props)
Removed:
    openoffice/branches/l10n/main/l10ntools/source/gConSrcUtil.cxx
Modified:
    openoffice/branches/l10n/main/l10ntools/source/gCon.cxx
    openoffice/branches/l10n/main/l10ntools/source/gConSrc.cxx
    openoffice/branches/l10n/main/l10ntools/source/gConSrc.hxx
    openoffice/branches/l10n/main/l10ntools/source/gConUlf.cxx
    openoffice/branches/l10n/main/l10ntools/source/gConXcs.cxx
    openoffice/branches/l10n/main/l10ntools/source/gConXcsWrap.cxx
    openoffice/branches/l10n/main/l10ntools/source/gConXcuWrap.cxx
    openoffice/branches/l10n/main/l10ntools/source/gConXhp.hxx
    openoffice/branches/l10n/main/l10ntools/source/gConXhpWrap.cxx
    openoffice/branches/l10n/main/l10ntools/source/gConXrm.hxx
    openoffice/branches/l10n/main/l10ntools/source/gConXrmWrap.cxx
    openoffice/branches/l10n/main/l10ntools/source/gLang.hxx
    openoffice/branches/l10n/main/l10ntools/source/makefile.mk

Modified: openoffice/branches/l10n/main/l10ntools/source/gCon.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gCon.cxx?rev=1442758&r1=1442757&r2=1442758&view=diff
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gCon.cxx (original)
+++ openoffice/branches/l10n/main/l10ntools/source/gCon.cxx Tue Feb  5 21:27:17 
2013
@@ -77,15 +77,16 @@ convert_gen& convert_gen::getConverter(c
   string sExtension = srSourceFile.substr(nInx+1);
 
   // did the user give a .xxx with the source file ?
-  if (sExtension == "hrc" || sExtension == "src") return *(new convert_src 
(srSourceFile, crMemory));
-  if (sExtension == "po")                         return *(new 
convert_po(srSourceFile, crMemory));
-  if (sExtension == "tree")                       return *(new 
convert_tree(srSourceFile, crMemory));
-  if (sExtension == "ulf")                        return *(new convert_ulf 
(srSourceFile, crMemory));
-  if (sExtension == "xcu")                        return *(new convert_xcu 
(srSourceFile, crMemory));
-  if (sExtension == "xcs")                        return *(new convert_xcs 
(srSourceFile, crMemory));
-  if (sExtension == "xrm")                        return *(new convert_xrm 
(srSourceFile, crMemory));
-  if (sExtension == "xhp")                        return *(new convert_xhp 
(srSourceFile, crMemory));
-  if (sExtension == "properties")                 return *(new 
convert_properties(srSourceFile, crMemory));
+  if (sExtension == "hrc")        return *(new convert_hrc       
(srSourceFile, crMemory));
+  if (sExtension == "src")        return *(new convert_src       
(srSourceFile, crMemory));
+  if (sExtension == "po")         return *(new convert_po        
(srSourceFile, crMemory));
+  if (sExtension == "tree")       return *(new convert_tree      
(srSourceFile, crMemory));
+  if (sExtension == "ulf")        return *(new convert_ulf       
(srSourceFile, crMemory));
+  if (sExtension == "xcu")        return *(new convert_xcu       
(srSourceFile, crMemory));
+  if (sExtension == "xcs")        return *(new convert_xcs       
(srSourceFile, crMemory));
+  if (sExtension == "xrm")        return *(new convert_xrm       
(srSourceFile, crMemory));
+  if (sExtension == "xhp")        return *(new convert_xhp       
(srSourceFile, crMemory));
+  if (sExtension == "properties") return *(new 
convert_properties(srSourceFile, crMemory));
 
   throw string("unknown extension on source file: ")+srSourceFile;
 }
@@ -134,7 +135,7 @@ void convert_gen::lineRead(bool *bEof, s
 
   // find next newline
   int nNextLF = msSourceBuffer.find('\n', mnSourceReadIndex);
-  if (nNextLF == msSourceBuffer.npos)
+  if (nNextLF == (int)msSourceBuffer.npos)
     nNextLF = msSourceBuffer.size()+1;
 
   // copy string
@@ -165,11 +166,11 @@ void convert_gen::trim(string& sLine)
 
   // remove leading spaces
   nL = sLine.find_first_not_of(" \t");
-  if (nL != string::npos)
+  if (nL != (int)string::npos)
     sLine.erase(0, nL);
 
   // remove trailing spaces
   nL = sLine.find_last_not_of(" \t");
-  if (nL != string::npos)
+  if (nL != (int)string::npos)
     sLine.erase(nL +1);
 }

Added: openoffice/branches/l10n/main/l10ntools/source/gConHrc.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConHrc.cxx?rev=1442758&view=auto
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gConHrc.cxx (added)
+++ openoffice/branches/l10n/main/l10ntools/source/gConHrc.cxx Tue Feb  5 
21:27:17 2013
@@ -0,0 +1,82 @@
+/**************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+using namespace std; 
+#include "gConHrc.hxx"
+
+
+
+
+/*****************************************************************************
+ *************************   G C O N H R C . C X X   *************************
+ *****************************************************************************
+ * This is the conversion for .hrc, it uses lex to analyze
+ *****************************************************************************/
+
+
+
+/*****************************   G L O B A L S   *****************************/
+convert_hrc_impl * convert_hrc::mcpImpl;
+
+
+
+/************   I N T E R F A C E   I M P L E M E N T A T I O N   ************/
+convert_hrc::convert_hrc(const string& srSourceFile, l10nMem& crMemory)
+                                : convert_gen(srSourceFile, crMemory) 
+                            {mcpImpl = new convert_hrc_impl(srSourceFile, 
crMemory);}
+convert_hrc::~convert_hrc() {delete mcpImpl;}
+void convert_hrc::extract() {mcpImpl->extract();}
+void convert_hrc::insert()  {mcpImpl->insert();}
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+convert_hrc_impl::convert_hrc_impl(const string& srSourceFile, l10nMem& 
crMemory)
+                                  : convert_gen(srSourceFile, crMemory),
+                                                                       
mbCollectingData(false)
+
+{
+}
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+convert_hrc_impl::~convert_hrc_impl()
+{
+}
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+void convert_hrc_impl::extract()
+{
+  // run lex parser and build token tree
+  runLex();
+
+  //JIX
+}
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+void convert_hrc_impl::insert()
+{
+  //JIX
+}

Propchange: openoffice/branches/l10n/main/l10ntools/source/gConHrc.cxx
------------------------------------------------------------------------------
    svn:executable = *

Added: openoffice/branches/l10n/main/l10ntools/source/gConHrc.hxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConHrc.hxx?rev=1442758&view=auto
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gConHrc.hxx (added)
+++ openoffice/branches/l10n/main/l10ntools/source/gConHrc.hxx Tue Feb  5 
21:27:17 2013
@@ -0,0 +1,84 @@
+/**************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+#ifndef GCONHRCHXX
+#define GCONHRCHXX
+#include "gLang.hxx"
+
+
+
+/*****************************************************************************
+ *************************   G C O N H R C . H X X   *************************
+ *****************************************************************************
+ * This is the class header for .hrc conversion
+ *****************************************************************************/
+
+
+
+/*****************   T E M P L A T E   D E F I N I T I O N   *****************/
+#if 0
+template<typename T>
+  void RemoveChars(std::basic_string<T> & Str, const T *CharsToRemove)
+  {
+    std::basic_string<T>::size_type pos = 0;
+    while ( (pos = Str.find_first_of(CharsToRemove, pos)) != 
std::basic_string<T>::npos)
+        Str.erase(pos, 1); 
+  }
+#endif
+
+
+
+/********************   C L A S S   D E F I N I T I O N   ********************/
+class convert_hrc_impl : public convert_gen
+{
+  public:
+    typedef enum
+    {
+      IGNORED      = 400,
+      COMMEND,        DEFINEDRES, ANYTOKEN,  UNKNOWNTOKEN,  
UNKNOWNCONSTRUCTION, UNKNOWNCHAR,
+      FILTER_LEVEL = 500,
+      CONDITION,      EMPTYLINE,  RESSOURCE, RESSOURCEEXPR, SMALRESSOURCE,     
  TEXTLINE,
+      LONGTEXTLINE,   TEXT,       LEVELUP,   LEVELDOWN,     APPFONTMAPPING,    
  ASSIGNMENT, 
+      LISTASSIGNMENT, LISTTEXT,   RSCDEFINE, RSCDEFINELEND, NEWTEXTINRES,      
  UIENTRIES, 
+      PRAGMA,         _LISTTEXT,  TEXTREFID, LISTRESID,     _LISTRESID,        
  NORMDEFINE
+    } LEX_TOKENS;
+
+    convert_hrc_impl(const string& srSourceFile, l10nMem& crMemory);
+    ~convert_hrc_impl();
+    
+    void addTokenToSet(LEX_TOKENS nToken, string srYYtext);
+    void addCommentToSet(LEX_TOKENS nToken, string srYYtext);
+
+  private:
+    class tokenStorageEntry
+    {
+      public:
+        tokenStorageEntry(LEX_TOKENS nToken, string& sYYtext): 
mnToken(nToken), msYYtext(sYYtext){};
+        LEX_TOKENS mnToken;
+        string     msYYtext;
+    };
+
+    void runLex();
+    void extract();
+    void insert();
+       bool mbCollectingData;
+    friend class convert_hrc;
+};
+#endif

Propchange: openoffice/branches/l10n/main/l10ntools/source/gConHrc.hxx
------------------------------------------------------------------------------
    svn:executable = *

Added: openoffice/branches/l10n/main/l10ntools/source/gConHrcWrap.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConHrcWrap.cxx?rev=1442758&view=auto
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gConHrcWrap.cxx (added)
+++ openoffice/branches/l10n/main/l10ntools/source/gConHrcWrap.cxx Tue Feb  5 
21:27:17 2013
@@ -0,0 +1,102 @@
+/**************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+using namespace std;
+#include "gConHrc.hxx"
+
+
+
+/*****************************************************************************
+ *********************   G C O N H R C W R A P . C X X   *********************
+ *****************************************************************************
+ * This includes the c code generated by flex
+ *****************************************************************************/
+
+
+
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+#include "gConHrc_yy.c"
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+void convert_hrc_impl::addTokenToSet(LEX_TOKENS nToken, string srYYtext)
+{
+//JIX
+#if 0
+  tokenStorage newToken;
+
+  newToken.mnToken = nToken;
+  newToken.msYYtext = srYYtext;
+
+  mcTokenSet.push_back(newToken);
+#endif
+}
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+void convert_hrc_impl::addCommentToSet(LEX_TOKENS nToken, string srYYtext)
+{
+  char buf[2];
+  bool check_comment_terminate;
+
+
+  // loop and collect whole comment
+  for (check_comment_terminate = false, buf[1] = '\0';;)
+  {
+    buf[0] = yyinput();
+
+    // end of file ?
+    if (!buf[0])
+      break;
+
+    // remember byte
+    srYYtext.append(buf);
+
+    // did we receive ยด*' ?
+    if (check_comment_terminate)
+    {
+      // end of comment ?
+      if (buf[0] == '/')
+        break;
+
+      // it was not the end of comment
+      check_comment_terminate = false;
+    }
+    else
+      // Start on end of comment ?
+      if (buf[0] == '*')
+        check_comment_terminate = true;
+  }
+
+  addTokenToSet(COMMEND, srYYtext);
+}
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+void convert_hrc_impl::runLex()
+{
+  genSrc_lex();
+}

Propchange: openoffice/branches/l10n/main/l10ntools/source/gConHrcWrap.cxx
------------------------------------------------------------------------------
    svn:executable = *

Added: openoffice/branches/l10n/main/l10ntools/source/gConHrclex.l
URL: 
http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConHrclex.l?rev=1442758&view=auto
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gConHrclex.l (added)
+++ openoffice/branches/l10n/main/l10ntools/source/gConHrclex.l Tue Feb  5 
21:27:17 2013
@@ -0,0 +1,154 @@
+/**************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+
+
+/*****************************************************************************
+ **********************   L E X   D E F I N I T I O N   **********************
+ *****************************************************************************
+ * lex grammar for parsing ressource source files (*.src and *.hrc files)
+ * file is converted to gConHrc_yy.cxx with "flex"
+ *****************************************************************************/
+
+
+
+/***************   O V E R W R I T I N G   F U N C T I O N S   ***************/
+%{
+/* enlarge token buffer to tokenize whole strings */
+#undef  YYLMAX
+#define YYLMAX 64000
+
+/* change reader function (input) to our own version */
+#define YY_INPUT(buf,result,max_size) { convert_hrc::mcpImpl->lexRead(buf, 
&result, max_size); }
+%}
+
+
+
+/*****************************   O P T I O N S   *****************************/
+/* 8bit               --> allow 8bit characters in the input stream   */
+/* noyywrap           --> yywrap is not called (single file scan)     */
+/* never-interactive  --> no check for console output                 */
+/* prefix=            --> yyFlexLexer change name                     */
+/* --- The following options are for future use (maybe)               */
+/* yyclass=           --> subClass yyFlexLexer to allow own functions */
+/* c++                --> generate C++ classes                        */
+%option 8bit noyywrap never-interactive prefix="genSrc_"
+%p 24000
+%e 1200
+%n 500
+
+
+
+/*******************   R U L E S   D E F I N I T I O N S   *******************/
+%%
+
+^[\t ]*"#pragma".*   {
+  convert_hrc::mcpImpl->addTokenToSet(convert_hrc_impl::PRAGMA, 
string(yytext)); }
+
+^[ \t]*\n   {
+  convert_hrc::mcpImpl->addTokenToSet(convert_hrc_impl::EMPTYLINE, 
string(yytext)); }
+
+[\t ]+               |
+^[\t ]*"#include".*  |
+^[\t ]*"#undef".*    |
+"//".*               |
+";"                  |
+"<"                  |
+">"                  |
+\n   {
+  convert_hrc::mcpImpl->addTokenToSet(convert_hrc_impl::IGNORED, 
string(yytext)); }
+
+"/*"   {
+  convert_hrc::mcpImpl->addCommentToSet(convert_hrc_impl::COMMEND, 
string(yytext)); }
+
+^[\t ]*"#ifndef".+$   |
+^[\t ]*"#ifdef".+$    |
+^[\t ]*"#if".+$       |
+^[\t ]*"#elif".+$     |
+^[\t ]*"#else".+$     |
+^[\t ]*"#endif".+$    {
+  convert_hrc::mcpImpl->addTokenToSet(convert_hrc_impl::CONDITION, 
string(yytext)); }
+
+[a-zA-Z]+[\t ]+[^={\n]+[\t ]   {
+  convert_hrc::mcpImpl->addTokenToSet(convert_hrc_impl::DEFINEDRES, 
string(yytext)); /* defined Res */ }
+
+[a-zA-Z]+[ \t]+[^={;\n]+\n[ \t]*"#".*\n[ \t]*"{"        |
+[a-zA-Z]+[ \t]+[^={;\n]+\n?([ \t]*"//".*\n)*[ \t]*"{"   {
+  convert_hrc::mcpImpl->addTokenToSet(convert_hrc_impl::RESSOURCE, 
string(yytext)); /* RESSOURCE // String TTT_XX ... */ }
+
+^[\t ]*[a-zA-Z_]+[\t ]*"\\"?[\t ]*\n?[ \t]*"{"[\t ]*"\\"?   {
+  convert_hrc::mcpImpl->addTokenToSet(convert_hrc_impl::SMALRESSOURCE, 
string(yytext)); /* SMALRESSOURCE // String ... */ }
+
+[\t ]*[a-zA-Z0-9_]+[ \t]*("["[ \t]*[a-zA-Z0-9_\-]+[ \t]*"]"[ \t]*)?=[ 
\t]*L?\".*\".*\n?   {
+  convert_hrc::mcpImpl->addTokenToSet(convert_hrc_impl::TEXTLINE, 
string(yytext)); /* TEXTLINE // TextTyp = "A Text" */ }
+
+[\t ]*[a-zA-Z0-9_]+[ \t]*("["[ \t]*[a-zA-Z0-9_\-]+[ \t]*"]"[ \t]*)?(\n[ 
\t]*)?=([ \t]*\n)?(([a-zA-Z0-9_]+)|(\".*\")|([ 
\t\n]*))*\".*\"(([a-zA-Z0-9_]+)|(\".*\")|([ \t\n]*))*;   {
+  convert_hrc::mcpImpl->addTokenToSet(convert_hrc_impl::LONGTEXTLINE, 
string(yytext)); /* LONGTEXTLINE // TextTyp = "A Text" HHH_XXX "A Text" ZZZ_TTT 
... */ }
+
+\".*\"   {
+  convert_hrc::mcpImpl->addTokenToSet(convert_hrc_impl::TEXT, string(yytext)); 
/* TEXT // "A Text" */ }
+
+"{"[ \t]*\\?   {
+  convert_hrc::mcpImpl->addTokenToSet(convert_hrc_impl::LEVELUP, 
string(yytext)); /* LEVELUP */ }
+
+"}"[ \t]*;([ \t]*\\)?   {
+  convert_hrc::mcpImpl->addTokenToSet(convert_hrc_impl::LEVELDOWN, 
string(yytext)); /* LEVELDOWN */ }
+
+[a-zA-Z0-9_]+[ \t]*"="[ \t]*"MAP_APPFONT"[ \t]*"(".+")".*   {
+  convert_hrc::mcpImpl->addTokenToSet(convert_hrc_impl::APPFONTMAPPING, 
string(yytext)); /* APPFONTMAPPING  Typ = MAP_APPFONT( ... ) */ }
+
+[ \t]*[a-zA-Z0-9_]+[ \t]*=[ \t]*[0123456789]{1,5}[ \t]*";"?\\?   {
+  convert_hrc::mcpImpl->addTokenToSet(convert_hrc_impl::TEXTREFID, 
string(yytext)); /* TEXTREFID // TextTyp = 12345 */ }
+
+[a-zA-Z0-9_]+[ \t]*"=".*                          | 
+[a-zA-Z0-9_]+[ \t]*"="[\t ]*([ \t]*"//".*\n)*.*   {
+  convert_hrc::mcpImpl->addTokenToSet(convert_hrc_impl::ASSIGNMENT, 
string(yytext)); /* ASSIGNMENT  Typ = ...  */ }
+
+[a-zA-Z0-9_]+[ \t]*("["[ \t]*[a-zA-Z0-9_\-]+[ \t]*"]"[ \t]*)?"="[ \t]*(\\[ 
\t]*)?\n?[ \t]*"{"[ \t]*(\\[ \t]*)?\n?[ \t]*"<"   {
+  convert_hrc::mcpImpl->addTokenToSet(convert_hrc_impl::LISTASSIGNMENT, 
string(yytext)); /* LISTASSIGNMENT  Typ [ ... ] = ... */ }
+
+"StringList"+[ \t]*("["[ \t]*[a-zA-Z0-9_\-]+[ \t]*"]"[ \t]*)?"="[ \t]*(\\[ 
\t]*)?\n?[ \t]*"{"[ \t]*(\\[ \t]*)?\n?[ \t]*   {
+  convert_hrc::mcpImpl->addTokenToSet(convert_hrc_impl::LISTASSIGNMENT, 
string(yytext)); /* LISTASSIGNMENT  Typ [ ... ] = ... */ }
+
+"UIEntries"[ \t]*("["[ \t]*[a-zA-Z0-9_\-]+[ \t]*"]"[ \t]*)?"="[ \t]*(\\[ 
\t]*)?\n?[ \t]*"{"   {
+  convert_hrc::mcpImpl->addTokenToSet(convert_hrc_impl::UIENTRIES, 
string(yytext)); /* UIENTRIES */ }
+
+"<"?[ \t]*L?\".*\".*">"   {
+  convert_hrc::mcpImpl->addTokenToSet(convert_hrc_impl::LISTTEXT, 
string(yytext)); /* LISTTEXT */ }
+
+[ \t]*"#define"[ \t]+[a-zA-Z0-9_]+.*"\\"   {
+  convert_hrc::mcpImpl->addTokenToSet(convert_hrc_impl::RSCDEFINE, 
string(yytext)); /* RSCDEFINE  #define ... */ }
+
+[ \t]*"#define"[ \t]+[a-zA-Z0-9_]+.+   {
+  convert_hrc::mcpImpl->addTokenToSet(convert_hrc_impl::NORMDEFINE, 
string(yytext)); /* #define ... */ }
+
+"\\"   {
+  convert_hrc::mcpImpl->addTokenToSet(convert_hrc_impl::RSCDEFINELEND, 
string(yytext)); /* RSCDEFINELEND */ }
+
+[a-zA-Z0-9_]+[ \t]*;   {
+  convert_hrc::mcpImpl->addTokenToSet(convert_hrc_impl::ANYTOKEN, 
string(yytext)); /* allowed other tokens like "49 ;" or "SFX_... ;" */ }
+
+.   {
+  convert_hrc::mcpImpl->addTokenToSet(convert_hrc_impl::UNKNOWNCHAR, 
string(yytext)); /* YYWarning( "Unknown Char" ); */ }
+
+"{"?[ \t]*\".*\"[ \t]*";"[ \t]*"}"   {
+  convert_hrc::mcpImpl->addTokenToSet(convert_hrc_impl::_LISTTEXT, 
string(yytext)); /* _LISTTEXT */ }
+
+%%

Propchange: openoffice/branches/l10n/main/l10ntools/source/gConHrclex.l
------------------------------------------------------------------------------
    svn:executable = *

Modified: openoffice/branches/l10n/main/l10ntools/source/gConSrc.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConSrc.cxx?rev=1442758&r1=1442757&r2=1442758&view=diff
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gConSrc.cxx (original)
+++ openoffice/branches/l10n/main/l10ntools/source/gConSrc.cxx Tue Feb  5 
21:27:17 2013
@@ -27,7 +27,7 @@ using namespace std;
 /*****************************************************************************
  *************************   G C O N S R C . C X X   *************************
  *****************************************************************************
- * This is the conversion for .src and .hrc files, it uses lex to analyze
+ * This is the conversion for .src, it uses lex to analyze
  *****************************************************************************/
 
 

Modified: openoffice/branches/l10n/main/l10ntools/source/gConSrc.hxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConSrc.hxx?rev=1442758&r1=1442757&r2=1442758&view=diff
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gConSrc.hxx (original)
+++ openoffice/branches/l10n/main/l10ntools/source/gConSrc.hxx Tue Feb  5 
21:27:17 2013
@@ -27,7 +27,7 @@
 /*****************************************************************************
  *************************   G C O N S R C . H X X   *************************
  *****************************************************************************
- * This is the class header for .src and .hrc conversion
+ * This is the class header for .src conversion
  *****************************************************************************/
 
 

Modified: openoffice/branches/l10n/main/l10ntools/source/gConUlf.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConUlf.cxx?rev=1442758&r1=1442757&r2=1442758&view=diff
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gConUlf.cxx (original)
+++ openoffice/branches/l10n/main/l10ntools/source/gConUlf.cxx Tue Feb  5 
21:27:17 2013
@@ -87,7 +87,7 @@ void convert_ulf::handleLines()
     if (bMultiLineComment)
     {
       nL = sWorkLine.find("*/");
-      if (nL == string::npos)
+      if (nL == (int)string::npos)
                continue;
 
       bMultiLineComment = false;
@@ -96,10 +96,10 @@ void convert_ulf::handleLines()
 
     // check for start of comment
     nL = sWorkLine.find("/*");
-    if (nL != string::npos)
+    if (nL != (int)string::npos)
     {
       int nE = sWorkLine.find("*/");
-      if (nE == string::npos)
+      if (nE == (int)string::npos)
       {
         bMultiLineComment = true;
         continue;
@@ -127,11 +127,11 @@ void convert_ulf::handleLines()
 
     // must be language line
     nL = sWorkLine.find_first_of("=");
-    if (nL == string::npos)
+    if (nL == (int)string::npos)
       throw "unknown format in " + msSourceFile + " missing = in line: " + 
sWorkLine;
 
     nL = sWorkLine.find_first_of("\"");
-    if (nL == string::npos)
+    if (nL == (int)string::npos)
       throw "unknown format: <<" + sWorkLine + ">> missing '='";
 
        if (!mbMergeMode)
@@ -147,7 +147,7 @@ void convert_ulf::handleLines()
       // get all languages (includes en-US)
       vector<l10nMem_entry *>& cExtraLangauges = 
mcMemory.getLanguagesForKey(sKey);
       string                   sNewLine;
-      int                      nL = cExtraLangauges.size();
+      nL = cExtraLangauges.size();
 
 
       for (int i = 0; i < nL; ++i)

Modified: openoffice/branches/l10n/main/l10ntools/source/gConXcs.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConXcs.cxx?rev=1442758&r1=1442757&r2=1442758&view=diff
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gConXcs.cxx (original)
+++ openoffice/branches/l10n/main/l10ntools/source/gConXcs.cxx Tue Feb  5 
21:27:17 2013
@@ -69,7 +69,8 @@ void convert_xcs_impl::extract()
   mbMergeMode = false;
 
   // run lex parser and build token tree
-  // CURRENTLY NOTHING TO TRANSLATE: runLex();
+  throw string("convert_xcs::extract not active");
+  runLex();
 }
 
 
@@ -81,7 +82,8 @@ void convert_xcs_impl::insert()
   mbMergeMode = true;
 
   // run lex parser and build token tree
-  // CURRENTLY NOTHING TO TRANSLATE: runLex();
+  throw string("convert_xcs::insert not active");
+  runLex();
 }
 
 

Modified: openoffice/branches/l10n/main/l10ntools/source/gConXcsWrap.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConXcsWrap.cxx?rev=1442758&r1=1442757&r2=1442758&view=diff
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gConXcsWrap.cxx (original)
+++ openoffice/branches/l10n/main/l10ntools/source/gConXcsWrap.cxx Tue Feb  5 
21:27:17 2013
@@ -61,7 +61,7 @@ void convert_xcs_impl::setKey(string& sC
 
   // locate key (is any)
   nL = sCollectedText.find("oor:name=\"");
-  if (nL == string::npos)
+  if (nL == (int)string::npos)
        return;
   sHead = sCollectedText.substr(nL+10);
   nL    = sHead.find("\"");
@@ -105,7 +105,7 @@ void convert_xcs_impl::stopCollectData(s
   // get type of tag
   msCollector += sCollectedText;
   nL = msCollector.find("<p");
-  if (nL != string::npos)
+  if (nL != (int)string::npos)
     sHead = msCollector.substr(nL+1, 1);
   else
   {
@@ -126,7 +126,7 @@ void convert_xcs_impl::stopCollectData(s
     // get all languages (includes en-US)
     vector<l10nMem_entry *>& cExtraLangauges = 
mcMemory.getLanguagesForKey(sKey);
     string                   sNewLine;
-    int                      nL = cExtraLangauges.size();
+    nL = cExtraLangauges.size();
 
     writeSourceFile(msCollector);
     msCollector.clear();

Modified: openoffice/branches/l10n/main/l10ntools/source/gConXcuWrap.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConXcuWrap.cxx?rev=1442758&r1=1442757&r2=1442758&view=diff
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gConXcuWrap.cxx (original)
+++ openoffice/branches/l10n/main/l10ntools/source/gConXcuWrap.cxx Tue Feb  5 
21:27:17 2013
@@ -58,13 +58,13 @@ void convert_xcu_impl::pushKeyPart(TAG_T
 
   // find key in tag
   nL = sTag.find("oor:name=\"");
-  if (nL == string::npos)
+  if (nL == (int)string::npos)
        return;
 
   // find end of key
   nL += 10;
   nE = sTag.find("\"", nL);
-  if (nE == string::npos)
+  if (nE == (int)string::npos)
        return;
 
   sKey = sTag.substr(nL, nE - nL);

Modified: openoffice/branches/l10n/main/l10ntools/source/gConXhp.hxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConXhp.hxx?rev=1442758&r1=1442757&r2=1442758&view=diff
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gConXhp.hxx (original)
+++ openoffice/branches/l10n/main/l10ntools/source/gConXhp.hxx Tue Feb  5 
21:27:17 2013
@@ -39,8 +39,8 @@ class convert_xhp_impl : public convert_
     convert_xhp_impl(const string& srSourceFile, l10nMem& crMemory);
     ~convert_xhp_impl();
 
-    void startCollectData(string& sType, string& sCollectedText);
-    void stopCollectData(string& sType, string& sCollectedText);
+    void startCollectData(string sType, string& sCollectedText);
+    void stopCollectData(string sType, string& sCollectedText);
     void collectData(string& sCollectedText);
 
   private:
@@ -55,4 +55,4 @@ class convert_xhp_impl : public convert_
 
     friend class convert_xhp;
 };
-#endif
\ No newline at end of file
+#endif

Modified: openoffice/branches/l10n/main/l10ntools/source/gConXhpWrap.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConXhpWrap.cxx?rev=1442758&r1=1442757&r2=1442758&view=diff
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gConXhpWrap.cxx (original)
+++ openoffice/branches/l10n/main/l10ntools/source/gConXhpWrap.cxx Tue Feb  5 
21:27:17 2013
@@ -48,7 +48,7 @@ void convert_xhp_impl::runLex()
 
 
 /**********************   I M P L E M E N T A T I O N   **********************/
-void convert_xhp_impl::startCollectData(string& sType, string& sCollectedText)
+void convert_xhp_impl::startCollectData(string sType, string& sCollectedText)
 {
   if (mbMergeMode)
     writeSourceFile(msCollector+sCollectedText);
@@ -66,7 +66,7 @@ void convert_xhp_impl::startCollectData(
 
 
 /**********************   I M P L E M E N T A T I O N   **********************/
-void convert_xhp_impl::stopCollectData(string& sType, string& sCollectedText)
+void convert_xhp_impl::stopCollectData(string sType, string& sCollectedText)
 {
   string sKey;
   int    nL;
@@ -85,7 +85,7 @@ void convert_xhp_impl::stopCollectData(s
     // get all languages (includes en-US)
     vector<l10nMem_entry *>& cExtraLangauges = 
mcMemory.getLanguagesForKey(sKey);
     string                   sNewLine;
-    int                      nL = cExtraLangauges.size();
+    nL = cExtraLangauges.size();
 
        // write en-US entry
     writeSourceFile(msCollector+sCollectedText);

Modified: openoffice/branches/l10n/main/l10ntools/source/gConXrm.hxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConXrm.hxx?rev=1442758&r1=1442757&r2=1442758&view=diff
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gConXrm.hxx (original)
+++ openoffice/branches/l10n/main/l10ntools/source/gConXrm.hxx Tue Feb  5 
21:27:17 2013
@@ -39,8 +39,8 @@ class convert_xrm_impl : public convert_
     convert_xrm_impl(const string& srSourceFile, l10nMem& crMemory);
     ~convert_xrm_impl();
 
-    void startCollectData(string& sType, string& sCollectedText);
-    void stopCollectData(string& sType, string& sCollectedText);
+    void startCollectData(string sType, string& sCollectedText);
+    void stopCollectData(string sType, string& sCollectedText);
     void collectData(string& sCollectedText);
 
   private:
@@ -55,4 +55,4 @@ class convert_xrm_impl : public convert_
 
     friend class convert_xrm;
 };
-#endif
\ No newline at end of file
+#endif

Modified: openoffice/branches/l10n/main/l10ntools/source/gConXrmWrap.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConXrmWrap.cxx?rev=1442758&r1=1442757&r2=1442758&view=diff
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gConXrmWrap.cxx (original)
+++ openoffice/branches/l10n/main/l10ntools/source/gConXrmWrap.cxx Tue Feb  5 
21:27:17 2013
@@ -49,7 +49,7 @@ void convert_xrm_impl::runLex()
 
 
 /**********************   I M P L E M E N T A T I O N   **********************/
-void convert_xrm_impl::startCollectData(string& sType, string& sCollectedText)
+void convert_xrm_impl::startCollectData(string sType, string& sCollectedText)
 {
   if (mbMergeMode)
     writeSourceFile(msCollector+sCollectedText);
@@ -63,7 +63,7 @@ void convert_xrm_impl::startCollectData(
 
 
 /**********************   I M P L E M E N T A T I O N   **********************/
-void convert_xrm_impl::stopCollectData(string& sType, string& sCollectedText)
+void convert_xrm_impl::stopCollectData(string sType, string& sCollectedText)
 {
   string sKey;
   int    nL;
@@ -82,7 +82,7 @@ void convert_xrm_impl::stopCollectData(s
     // get all languages (includes en-US)
     vector<l10nMem_entry *>& cExtraLangauges = 
mcMemory.getLanguagesForKey(sKey);
     string                   sNewLine;
-    int                      nL = cExtraLangauges.size();
+    nL = cExtraLangauges.size();
 
        // write en-US entry
     writeSourceFile(msCollector+sCollectedText);

Modified: openoffice/branches/l10n/main/l10ntools/source/gLang.hxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gLang.hxx?rev=1442758&r1=1442757&r2=1442758&view=diff
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gLang.hxx (original)
+++ openoffice/branches/l10n/main/l10ntools/source/gLang.hxx Tue Feb  5 
21:27:17 2013
@@ -148,6 +148,25 @@ class convert_src : public convert_gen
 
 
 /********************   C L A S S   D E F I N I T I O N   ********************/
+class convert_hrc_impl;
+class convert_hrc : public convert_gen
+{
+  public:
+    static convert_hrc_impl *mcpImpl;
+
+
+    convert_hrc(const string& srSourceFile, l10nMem& crMemory);
+    ~convert_hrc();
+    
+    void extract();
+    void insert();
+
+  private:
+};
+
+
+
+/********************   C L A S S   D E F I N I T I O N   ********************/
 class convert_tree : public convert_gen
 {
   public:

Modified: openoffice/branches/l10n/main/l10ntools/source/makefile.mk
URL: 
http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/makefile.mk?rev=1442758&r1=1442757&r2=1442758&view=diff
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/makefile.mk (original)
+++ openoffice/branches/l10n/main/l10ntools/source/makefile.mk Tue Feb  5 
21:27:17 2013
@@ -166,10 +166,36 @@ APP7STDLIBS+= \
 # static libs at end for OS X
 .ENDIF
 
+# localizer for new l10n framework
 # 
-#APP8TARGET= treeconfig
-#APP8OBJS=   $(OBJ)$/treeconfig.obj $(OBJ)$/inireader.obj $(OBJ)$/export2.obj
-#APP8STDLIBS=$(TOOLSLIB) $(SALLIB) $(VOSLIB) $(ICUINLIB) $(STLPORT) 
+APP8OBJS= $(OBJ)$/gLang.obj \
+          $(OBJ)$/gL10nMem.obj \
+          $(OBJ)$/gHandler.obj \
+          $(OBJ)$/gConProp.obj \
+          $(OBJ)$/gConHrc.obj \
+          $(OBJ)$/gConSrc.obj \
+          $(OBJ)$/gConTree.obj \
+          $(OBJ)$/gConUlf.obj \
+          $(OBJ)$/gConPo.obj \
+          $(OBJ)$/gConXcs.obj \
+          $(OBJ)$/gConXcu.obj \
+          $(OBJ)$/gConXhp.obj \
+          $(OBJ)$/gConXrm.obj \
+          $(OBJ)$/gCon.obj \
+          $(OBJ)$/gConPoWrap.obj \
+          $(OBJ)$/gConHrcWrap.obj \
+          $(OBJ)$/gConSrcWrap.obj \
+          $(OBJ)$/gConXcsWrap.obj \
+          $(OBJ)$/gConXcuWrap.obj \
+          $(OBJ)$/gConXrmWrap.obj \
+          $(OBJ)$/gConXhpWrap.obj 
+APP8RPATH=  NONE
+APP8STDLIBS+= $(TOOLSLIB) \
+              $(VOSLIB) \
+              $(SALLIB)
+APP8TARGET= genLang
+
+DEPOBJFILES=$(APP8OBJS)
 
 # localizer for l10n framework
 APP9TARGET= localize_sl
@@ -197,39 +223,11 @@ $(MISC)$/%_yy.c : %lex.l
 
 # --- Files --------------------------------------------------------
 
-# localizer for new l10n framework
-# 
-APP8TARGET= genLang
-APP8OBJS= $(OBJ)$/gLang.obj \
-          $(OBJ)$/gL10nMem.obj \
-          $(OBJ)$/gHandler.obj \
-          $(OBJ)$/gConProp.obj \
-          $(OBJ)$/gConSrc.obj \
-          $(OBJ)$/gConSrcUtil.obj \
-          $(OBJ)$/gConTree.obj \
-          $(OBJ)$/gConUlf.obj \
-          $(OBJ)$/gConPo.obj \
-          $(OBJ)$/gConXcs.obj \
-          $(OBJ)$/gConXcu.obj \
-          $(OBJ)$/gConXhp.obj \
-          $(OBJ)$/gConXrm.obj \
-          $(OBJ)$/gCon.obj \
-          $(OBJ)$/gConPoWrap.obj \
-          $(OBJ)$/gConSrcWrap.obj \
-          $(OBJ)$/gConXcsWrap.obj \
-          $(OBJ)$/gConXcuWrap.obj \
-          $(OBJ)$/gConXrmWrap.obj \
-          $(OBJ)$/gConXhpWrap.obj 
-APP8RPATH=  NONE
-APP8STDLIBS+= $(TOOLSLIB) \
-              $(VOSLIB) \
-              $(SALLIB)
-
-DEPOBJFILES=$(APP8OBJS)
 
 # Helper to suppress warnings in lex generated c code, see #i57362#
 
 $(OBJ)$/gConPoWrap.obj: $(MISC)$/gConPo_yy.c
+$(OBJ)$/gConHrcWrap.obj: $(MISC)$/gConHrc_yy.c
 $(OBJ)$/gConSrcWrap.obj: $(MISC)$/gConSrc_yy.c
 $(OBJ)$/gConXcuWrap.obj: $(MISC)$/gConXcu_yy.c
 $(OBJ)$/gConXcsWrap.obj: $(MISC)$/gConXcs_yy.c


Reply via email to