Revision: 65377
          http://sourceforge.net/p/brlcad/code/65377
Author:   starseeker
Date:     2015-06-18 11:52:18 +0000 (Thu, 18 Jun 2015)
Log Message:
-----------
Apply patch #375 from Ilinca Andrei - functional basic csg parser.

Modified Paths:
--------------
    brlcad/trunk/src/conv/csg/csg_parser.lemon
    brlcad/trunk/src/conv/csg/csg_scanner.perplex

Modified: brlcad/trunk/src/conv/csg/csg_parser.lemon
===================================================================
--- brlcad/trunk/src/conv/csg/csg_parser.lemon  2015-06-18 03:17:34 UTC (rev 
65376)
+++ brlcad/trunk/src/conv/csg/csg_parser.lemon  2015-06-18 11:52:18 UTC (rev 
65377)
@@ -41,21 +41,25 @@
 /* priorities , not sure if this is how is intended to be used */
 
 %left GROUP_BEGIN.
+/*
 %left GROUP_CONTENT.
 %left GROUP_END.
+*/
 
-
 /* I believe here I get the compiling error */
-start_symbol ::= block.
+start_symbol ::= code. 
 
 //source ::= /* empty */.
 
 /* Initial, simple grammar, just for testing  */
-block ::= code.
-code ::= group_begin.
+
+code ::= groupb.  
+
+groupb::= GROUP_BEGIN.  
 {
   fprintf(appData->outfile, "we found group() {\n");
 }
+/*
 group_begin ::= GROUP_BEGIN group_content.
 {
   fprintf(appData->outfile, "in group(), we found %s 
",bu_vls_addr(&appData->description));
@@ -64,3 +68,4 @@
 {
   fprintf(appData->outfile, "we found the end of group()");
 }
+*/

Modified: brlcad/trunk/src/conv/csg/csg_scanner.perplex
===================================================================
--- brlcad/trunk/src/conv/csg/csg_scanner.perplex       2015-06-18 03:17:34 UTC 
(rev 65376)
+++ brlcad/trunk/src/conv/csg/csg_scanner.perplex       2015-06-18 11:52:18 UTC 
(rev 65377)
@@ -35,28 +35,27 @@
 
 /* condition states - no idea what this enum does but I modified it according
 to what I used below */
-enum {INITIAL, code, group, group_in};
+enum {INITIAL, code, group, groupb};
 
 %%
 <> => code { continue; }
 
-/* matching group() { , functions inside group() and the end of group() */
-
 optional_ws = [ \t]*;
 
 group_begin = "group() {";
 group_content = [a-z]+ "("*")";
 group_end = "}";
 
-/* returning the tokens found, not sure if correct or not */
 <code>  {
-(optional_ws)(group_begin) {
+(group_begin) {
+    YYSETCONDITION(code);
     return GROUP_BEGIN;
   }
+[^] { continue; }
 }
-
+/*
 <group> {
-(optional_ws)(group_content) {
+(group_end) {
      YYSETCONDITION(code);
      return GROUP_CONTENT;
    }
@@ -66,4 +65,6 @@
      YYSETCONDITION(group);
      return GROUP_END;
 }
+[^] { continue; }
 }
+*/

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to