This project is read-only.

Problem creating new primitive

Topics: Gesture Definition
May 26, 2011 at 12:47 AM

Hi Shahed,

I've followed the instructions in  (

to create a new primitive but after editing the PrimitiveConditions.pd and PrimitiveConditionSyntax.pd files i got the following error when I try to compile

Compile complete -- 0 errors, 1 warnings  ..\  bin\Debug\  DemoApp  Loading language grammar...  Building parser from language...  Failed to compile GDL ....  DemoApp -> C:\Users\ASE\Documents\Visual Studio 2010\Projects\DemoApp\DemoApp\bin\Debug\DemoApp.exe


Those are the contents of my files:



/* Define one primitive condition per line. 
 * For example:
 *  | r: ClosedLoop => r
 *  | r: MyPrimitiveCon02 => r

 | r : "angleBetween" => r



(If I don't define the syntax for shape here, I got an error saying:  Exception while parsing to xaml: (10,9): error 5007: Token ValidName with text "angleBetween" unexpected.)



 *  Add the parsing logic for new PreConditions here separated by new lines. 
 *  For example:
 *       syntax PerpendicularTo
 *           = g1:ValidName "perpendicularTo" g2:ValidName
 *           => PerpendicularTo {Gesture1=>g1, Gesture2=>g2};
 *       syntax TouchShape
 *           = "Touch shape" ":" s:Shape
 *           =>TouchShape{Values=>s};

 syntax angleBetween
	=  g1:ValidName "angleBetween" g2:ValidName	
	=> angleBetween {Gesture1=>g1, Gesture2=>g2};

 syntax TouchShape
            = "Touch shape" ":" s:Shape


my Gesture Definition

name: check1

validate as line1
    Touch state: TouchUp and
	Touch shape: Line and
validate as line2
	  Touch state: TouchUp and
	  Touch shape: Line and
  line1 angleBetween line2     

    	Touch paths





Any idea about what the problem might be? 




May 26, 2011 at 2:44 AM
Edited May 26, 2011 at 2:45 AM

Hi Tulio,

You followed the right steps. However, Would you please double check if you have added "AngleBetween" and "AngleBetweenValidator" classes under the same namespace of your project. It should be under your project namespace (not under framework namespaces).

By the way, you can fork the source code anytime from and maintain a independent branch for your code.

May 28, 2011 at 12:33 AM

Hi Shahed!

Yes, the files are under the project namespace.


May 28, 2011 at 1:15 AM

hmm... thats interesting. It should automatically pick the right classes and add into the runtime. I will try to reproduce you scenario in the weekend and let you know.