Re: All these errors running basic Pegged helloworld example.

2019-01-11 Thread 0xEAB via Digitalmars-d-learn

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/yhftsrkylskbigoan...@forum.dlang.org


Re: All these errors running basic Pegged helloworld example.

2019-01-11 Thread Steven Schveighoffer via Digitalmars-d-learn

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


Re: All these errors running basic Pegged helloworld example.

2019-01-11 Thread Enjoys Math via Digitalmars-d-learn

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!


Re: All these errors running basic Pegged helloworld example.

2019-01-11 Thread Michelle Long via Digitalmars-d-learn

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 
_D6pegged7dynamic7grammar7grammarFAyaHAyaDFS6pegged3peg9ParseTreeZS6pegged3peg9ParseTreeZS6pegged7dynamic7grammar14DynamicGrammar (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\	


The # of errors was greatly reduced when I added the 3 pegged 
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.


Re: All these errors running basic Pegged helloworld example.

2019-01-11 Thread Enjoys Math via Digitalmars-d-learn

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 
_D6pegged7dynamic7grammar7grammarFAyaHAyaDFS6pegged3peg9ParseTreeZS6pegged3peg9ParseTreeZS6pegged7dynamic7grammar14DynamicGrammar (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\	


The # of errors was greatly reduced when I added the 3 pegged 
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 pegged.lib and your custom 
sources files.


Thanks, I downloaded Coedit, but it's not working with pegged 
(using the library manager dub button)


Re: All these errors running basic Pegged helloworld example.

2015-09-27 Thread BBasile via Digitalmars-d-learn

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 
_D6pegged7dynamic7grammar7grammarFAyaHAyaDFS6pegged3peg9ParseTreeZS6pegged3peg9ParseTreeZS6pegged7dynamic7grammar14DynamicGrammar (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\	


The # of errors was greatly reduced when I added the 3 pegged 
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 pegged.lib and your custom sources 
files.