English 中文(简体)
Prolog: DCGyntax Error
原标题:Prolog: DCG Syntax Error

我不想把“功能要求”混为一谈。

:30:0 Syntax error: Operator expected

下面第一行是我犯错误之处:

Fun(FXs) -->   name(F),
                ws,
                [0 (],
                ws,
                args(Xs),
                ws,
                [0 )],
                {FXs =.. [F, Xs]}.

 name(N) -->  id(Cs),
             {atom_chars(Cs, N)}.

I have exhaustively searched Google for help with errors in DCG parsing, and I have not found anything. An explanation on what I am doing wrong will be helpful, or any resources that would allow me to understand DCG more!

最佳回答

我想到的是Fun:你应写上fun。 SWI-Prolog有一个延伸,允许CamelCase functors,但必须允许。

问题回答

暂无回答




相关问题
SQL Server 2000 "Incorrect syntax near the keyword CASE "

The error is return when the following stored proc is attempted to be executed: EXECUTE p_someProc --list of vars CASE WHEN @var1=1 AND @var2=1 THEN 3 WHEN @var2=1 THEN 2 WHEN @var1=1 ...

Why is this Haskell incorrect?

I have a Haskell file which looks like this: longest::[Integer]->[Integer]->[Integer] max a b = if length a > length b then a else b llfs::[Integer]->Integer llfs li = length(foldl ...

How do I find the compilation error in this Perl statement?

I have this code: my $orig_file_size = -s $file ; Is throwing an error: syntax error at ftp_4 line 33, near "$orig_file_size)" Execution of ftp_4 aborted due to compilation errors. Here is some ...

热门标签