www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - All these errors running basic Pegged helloworld example.

reply Enjoys Math <enjoysmath gmail.com> writes:
The example is:

import pegged.grammar;

mixin(grammar(`
Arithmetic:
     Term     < Factor (Add / Sub)*
     Add      < "+" Factor
     Sub      < "-" Factor
     Factor   < Primary (Mul / Div)*
     Mul      < "*" Primary
     Div      < "/" Primary
     Primary  < Parens / Neg / Pos / Number / Variable
     Parens   < "(" Term ")"
     Neg      < "-" Primary
     Pos      < "+" Primary
     Number   < ~([0-9]+)

     Variable <- identifier
`));

I'm using Visual D and have C:\MyProjects\D\Pegged (the git clone 
of pegged) added to the add'l imports field under project 
properties > compiler.

I'm getting errors like these:

Error	1	Error 42: Symbol Undefined 
_D6pegged7dynamic7grammar7grammarFAyaHAyaDFS6pegged3peg9ParseTreeZS6pegged3peg9ParseTreeZS6pegged7dynamic7gra
mar14DynamicGrammar (pegged.dynamic.grammar.DynamicGrammar
pegged.dynamic.grammar.grammar(immutable(char)[], pegged.peg.ParseTree
delegate(pegged.peg.ParseTree)[immutable(char)[]]))	C:\MyProjects\D\PeggedPractice\	
Error	2	Error 42: Symbol Undefined 
_D6pegged7dynamic7grammar12__ModuleInfoZ	C:\MyProjects\D\PeggedPractice\	


source files to my project.   What can be going wrong?  Thanks!
Sep 26 2015
next sibling parent reply BBasile <bb.temp gmx.com> writes:
On Sunday, 27 September 2015 at 06:30:37 UTC, Enjoys Math wrote:
 The example is:

 import pegged.grammar;

 mixin(grammar(`
 Arithmetic:
     Term     < Factor (Add / Sub)*
     Add      < "+" Factor
     Sub      < "-" Factor
     Factor   < Primary (Mul / Div)*
     Mul      < "*" Primary
     Div      < "/" Primary
     Primary  < Parens / Neg / Pos / Number / Variable
     Parens   < "(" Term ")"
     Neg      < "-" Primary
     Pos      < "+" Primary
     Number   < ~([0-9]+)

     Variable <- identifier
 `));

 I'm using Visual D and have C:\MyProjects\D\Pegged (the git 
 clone of pegged) added to the add'l imports field under project 
 properties > compiler.

 I'm getting errors like these:

 Error	1	Error 42: Symbol Undefined 
 _D6pegged7dynamic7grammar7grammarFAyaHAyaDFS6pegged3peg9ParseTreeZS6pegged3peg9ParseTreeZS6pegged7dynamic7gra
mar14DynamicGrammar (pegged.dynamic.grammar.DynamicGrammar
pegged.dynamic.grammar.grammar(immutable(char)[], pegged.peg.ParseTree
delegate(pegged.peg.ParseTree)[immutable(char)[]]))	C:\MyProjects\D\PeggedPractice\	
 Error	2	Error 42: Symbol Undefined 
 _D6pegged7dynamic7grammar12__ModuleInfoZ	C:\MyProjects\D\PeggedPractice\	


 source files to my project.   What can be going wrong?  Thanks!
You must also pass the source root with -I: -IC:\MyProjects\D\Pegged (and maybe you miss another source since there are 5: '..\repos\Pegged\pegged\grammar.d' '..\repos\Pegged\pegged\parser.d' '..\repos\Pegged\pegged\peg.d' '..\repos\Pegged\pegged\dynamic\grammar.d' '..\repos\Pegged\pegged\dynamic\peg.d' ) By the way with Coedit you wouldn't have this kind of problems (Pegged is part of metaD). You can even run some test on Pegged without saving the file / without a project (this is called a runnable module). This is just what I've done. At least compile pegged as a static lib, then it's simpler, you just have to pass the -I<root> pegged.lib and your custom sources files.
Sep 27 2015
parent reply Enjoys Math <enjoysmath gmail.com> writes:
On Sunday, 27 September 2015 at 07:16:51 UTC, BBasile wrote:
 On Sunday, 27 September 2015 at 06:30:37 UTC, Enjoys Math wrote:
 The example is:

 import pegged.grammar;

 mixin(grammar(`
 Arithmetic:
     Term     < Factor (Add / Sub)*
     Add      < "+" Factor
     Sub      < "-" Factor
     Factor   < Primary (Mul / Div)*
     Mul      < "*" Primary
     Div      < "/" Primary
     Primary  < Parens / Neg / Pos / Number / Variable
     Parens   < "(" Term ")"
     Neg      < "-" Primary
     Pos      < "+" Primary
     Number   < ~([0-9]+)

     Variable <- identifier
 `));

 I'm using Visual D and have C:\MyProjects\D\Pegged (the git 
 clone of pegged) added to the add'l imports field under 
 project properties > compiler.

 I'm getting errors like these:

 Error	1	Error 42: Symbol Undefined 
 _D6pegged7dynamic7grammar7grammarFAyaHAyaDFS6pegged3peg9ParseTreeZS6pegged3peg9ParseTreeZS6pegged7dynamic7gra
mar14DynamicGrammar (pegged.dynamic.grammar.DynamicGrammar
pegged.dynamic.grammar.grammar(immutable(char)[], pegged.peg.ParseTree
delegate(pegged.peg.ParseTree)[immutable(char)[]]))	C:\MyProjects\D\PeggedPractice\	
 Error	2	Error 42: Symbol Undefined 
 _D6pegged7dynamic7grammar12__ModuleInfoZ	C:\MyProjects\D\PeggedPractice\	


 source files to my project.   What can be going wrong?  Thanks!
You must also pass the source root with -I: -IC:\MyProjects\D\Pegged (and maybe you miss another source since there are 5: '..\repos\Pegged\pegged\grammar.d' '..\repos\Pegged\pegged\parser.d' '..\repos\Pegged\pegged\peg.d' '..\repos\Pegged\pegged\dynamic\grammar.d' '..\repos\Pegged\pegged\dynamic\peg.d' ) By the way with Coedit you wouldn't have this kind of problems (Pegged is part of metaD). You can even run some test on Pegged without saving the file / without a project (this is called a runnable module). This is just what I've done. At least compile pegged as a static lib, then it's simpler, you just have to pass the -I<root> pegged.lib and your custom sources files.
Thanks, I downloaded Coedit, but it's not working with pegged (using the library manager dub button)
Jan 11 2019
parent 0xEAB <desisma heidel.beer> writes:
On Friday, 11 January 2019 at 17:35:40 UTC, Enjoys Math wrote:
 Thanks, I downloaded Coedit, but it's not working with pegged 
 (using the library manager dub button)
According to your post in [0], it didn't work because you had a typo in `pegged`. Maybe correct it and try again :) - Elias [0] https://forum.dlang.org/thread/yhftsrkylskbigoanzlb forum.dlang.org
Jan 11 2019
prev sibling parent reply Michelle Long <HappyDance321 gmail.com> writes:
On Sunday, 27 September 2015 at 06:30:37 UTC, Enjoys Math wrote:
 The example is:

 import pegged.grammar;

 mixin(grammar(`
 Arithmetic:
     Term     < Factor (Add / Sub)*
     Add      < "+" Factor
     Sub      < "-" Factor
     Factor   < Primary (Mul / Div)*
     Mul      < "*" Primary
     Div      < "/" Primary
     Primary  < Parens / Neg / Pos / Number / Variable
     Parens   < "(" Term ")"
     Neg      < "-" Primary
     Pos      < "+" Primary
     Number   < ~([0-9]+)

     Variable <- identifier
 `));

 I'm using Visual D and have C:\MyProjects\D\Pegged (the git 
 clone of pegged) added to the add'l imports field under project 
 properties > compiler.

 I'm getting errors like these:

 Error	1	Error 42: Symbol Undefined 
 _D6pegged7dynamic7grammar7grammarFAyaHAyaDFS6pegged3peg9ParseTreeZS6pegged3peg9ParseTreeZS6pegged7dynamic7gra
mar14DynamicGrammar (pegged.dynamic.grammar.DynamicGrammar
pegged.dynamic.grammar.grammar(immutable(char)[], pegged.peg.ParseTree
delegate(pegged.peg.ParseTree)[immutable(char)[]]))	C:\MyProjects\D\PeggedPractice\	
 Error	2	Error 42: Symbol Undefined 
 _D6pegged7dynamic7grammar12__ModuleInfoZ	C:\MyProjects\D\PeggedPractice\	


 source files to my project.   What can be going wrong?  Thanks!
You need to add most of the pegged files... there are more than 3. Try adding them all first then remove the junk like the examples, docs, etc until it works.
Jan 11 2019
parent reply Enjoys Math <enjoysmath gmail.com> writes:
On Friday, 11 January 2019 at 17:44:33 UTC, Michelle Long wrote:
 On Sunday, 27 September 2015 at 06:30:37 UTC, Enjoys Math wrote:
 [...]
You need to add most of the pegged files... there are more than 3. Try adding them all first then remove the junk like the examples, docs, etc until it works.
Why should I do that? There's a DUB feature in Coedit... it should work!
Jan 11 2019
parent Steven Schveighoffer <schveiguy gmail.com> writes:
On 1/11/19 1:21 PM, Enjoys Math wrote:
 On Friday, 11 January 2019 at 17:44:33 UTC, Michelle Long wrote:
 On Sunday, 27 September 2015 at 06:30:37 UTC, Enjoys Math wrote:
 [...]
You need to add most of the pegged files... there are more than 3. Try adding them all first then remove the junk like the examples, docs, etc until it works.
Why should I do that?  There's a DUB feature in Coedit... it should work!
Just keep in mind folks, that the post replied to was from September 2015. -Steve
Jan 11 2019