Giter Club home page Giter Club logo

loco's People

Contributors

brzuchal avatar hansott avatar qntm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

loco's Issues

License missing

In order for this project to gain some footing, you need to provide a license - most developers are working in a commercial setting of some sort, and won't consider contributing unless the code is properly licensed.

Which parser to use for non-terminal to non-terminal rule??

Which class do you use to represent a non-terminal to a non-terminal rule??

<script>          ::= <statements>
<statements> ::= <statements> <statement> | <statement>
<statement>   ::= <assignment-stm> | <return-stm>
...

new Ferno\Loco\Grammar(
	"<script>",
	array(
		"<script>" => ???                  <- to <statements>
	),
	function($script)
	{
		return $script;
	}
);

Loco Question, MatchParser

I am playing with a Matchparser but as somewhat newbie to parsing and lexing, i am wondering if there is place for such a parser in the library, or that it might be totally beyond the scope of loco.

The idea is that instead of using a ConcParser for every possible known xml or html tag <p <h etc. just fetch matching pairs.

new MatchParser( array(
   '<', 'name', '>','content','</', 'name', '>',
   1, 4 // should match and not be nullable
))
//...

/*
<channel>
   <item></item>
   <xxx></xxx>
</channel>
*/

I made a copy of the ConcParser where two internals have to match. During construct it is checked that both internals are identical, and during parsing the two args[] should be identical, otherwise throw an exception.

I haven't found out an easy way how to check that both the matching internals should not be nullable.

The MatchParser can be found in this gist, as i didn't want to do a pull request, before knowing if this type of parser might be out of order.

https://gist.github.com/3783791

Composer.json

Thank you for adding the composer.json. It would be great if you could submit this repository to packagist.org too. Before that, version-tagging the repository is important.

PSR Coding Standards

I migrated the codebase towards PSR coding standards, namespaces and auto-loading.

https://github.com/mindplay-dk/loco

I did not submit a pull-request (yet) because the addition of namespaces breaks backwards compatibility - I figured there's a good chance you would want to start a 2.0 branch first, if you're willing to pull my changes?

I'm hoping this will help the project gain some traction, as following standards will appeal to a broader community and makes it easier to contribute.

I left the example/test scripts alone, for the most part - I didn't want to break your formatting, so these files do not follow standards at the moment. Only the core library has been migrated to use namespaces.

All the example code has been tested and works with these changes.

Run tests error

if(FILE !== $_SERVER["PHP_SELF"]) {
return;
}

for me (php5.3, windows) it's full path in FILE and only file name in $_SERVER["PHP_SELF"]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.