Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 50d312c

Browse files
committed
updated
1 parent 8a4af78 commit 50d312c

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

‎.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
/target/
2-
prologparser.iml
3-
/.idea/
2+
/.idea/
3+
*.iml

‎README.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
[![YooMoney donation](https://img.shields.io/badge/donation-Yoo.money-blue.svg)](https://yoomoney.ru/to/41001158080699)
66

77

8-
# Preword
8+
# Pre-word
99

10-
During my development of Java prolog engine (JProl) I had developed parser to parse sources written in Edinburgh style, I decided to extract the module into separated project and 1.0.0 version was published. In 2018 I had decided to make deep refactoring and 2.0.0 version was published. The Parser allows build custom prolog parsers with support of operators and some modern prolog features.
10+
During [my experiments in Prolog with Java](https://github.com/raydac/jprol), I developed some parser to process Prolog sources written in Edinburgh style. I decided that it is useful stuff, and it would be good to be prepared as separated independent module published in Maven central. In 2018 deep refactoring made the parser better and stronger.
1111

1212
# Features
1313

@@ -19,7 +19,7 @@ It supports
1919

2020
# Maven dependency
2121

22-
It is a library without 3th side dependencies, it is published im the Maven central and can be added into project just with:
22+
The parser is a pure Java library without any 3-th side dependency, it is published im the Maven central and can be injected into project just by adding:
2323
```
2424
<dependency>
2525
<groupId>com.igormaznitsa</groupId>
@@ -29,17 +29,18 @@ It is a library without 3th side dependencies, it is published im the Maven cent
2929
```
3030

3131
# How to use?
32-
Parser implements stream which sequentially reads prolog terms from reader. By default PrologParser is abstract class but there is GenericPrologParser class provides minimalistic implementation.
32+
Parser implements stream which sequentially reads prolog terms provided by reader. By default, PrologParser is abstract class but there is pre-defined implementation GenericPrologParser for common cases.
3333
```
34-
Reader reader = new StringReader("hello(world). some({1,2,3}). power(X,Y,Z) :- Z is X ** Y.");
35-
PrologParser parser = new GenericPrologParser(reader, new DefaultParserContext(ParserContext.FLAG_CURLY_BRACKETS, Op.SWI));
36-
parser.forEach(System.out::println);
34+
Reader reader = new StringReader("hello(world). some({1,2,3}). power(X,Y,Z) :- Z is X ** Y.");
35+
ParserContext context = DefaultParserContext.of(ParserContext.FLAG_CURLY_BRACKETS, Op.SWI);
36+
PrologParser parser = new GenericPrologParser(reader, context);
37+
parser.forEach(System.out::println);
3738
```
3839

3940
# Supported Prolog terms
40-
The parser supports
41+
Supported tokens:
4142
- atoms (class PrologAtom)
42-
- numbers (classes PrologInt and PrologFloat), they are based on big numbers so that their size is not restricted
43+
- numbers (classes PrologInt and PrologFloat), they are based on java big number classes so that their size is limited mainly only by heap
4344
- lists (class PrologList)
4445
- structures (class PrologStruct)
4546
- variables (class PrologVar)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /