Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parsing Error "unrecognized token" #3

Open
AdjWang opened this issue May 27, 2023 · 2 comments
Open

Parsing Error "unrecognized token" #3

AdjWang opened this issue May 27, 2023 · 2 comments

Comments

@AdjWang
Copy link

AdjWang commented May 27, 2023

Hello,
I have tried to convert Voxel.pas here

but getting an error:

$ ./ptoc -in ../vxlseiii14x.r583/source/document/Voxel.pas
../vxlseiii14x.r583/source/document/Voxel.pas:1 11 error: unrecognized token:

I cloned ptoc to wsl and compiled it by make. My make version:

$ make -v
GNU Make 4.3
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

System info:

$ uname -a
Linux DESKTOP-AML6IP6 5.15.90.1-microsoft-standard-WSL2 #1 SMP Fri Jan 27 02:56:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

Thank you very much for all your help.

Kind regards,
WWang.

@knizhnik
Copy link
Owner

This file has Dos/Win CR/LF convention and you are trying to convert it at Unix.
Please replace CR/LF with CR.
For example it can be done using dos2unix utility or zip:

zip voxel.zip Voxel.pas
unzip -a voxel.zip

Also please notice that it is Turbo Pascal file, so you need to specify -turbo option:

./ptoc -turbo -in ../vxlseiii14x.r583/source/document/Voxel.pas

@AdjWang
Copy link
Author

AdjWang commented May 28, 2023

It works! Thanks for your help!

... then I'm getting another syntax error when converting normal.pas

$ ../../ptoc/ptoc -I maths/ -in ./document/normals.pas -turbo
./document/normals.pas:8 0 warning: can't include file basicmathstypes.pas
./document/normals.pas:8 0 warning: can't include file normalsconstants.pas
./document/normals.pas:68 0 warning: can't include file basicfunctions.pas
maths//math3d.pas:5 0 warning: can't include file basicmathstypes.pas
./document/normals.pas:15 6 (token TKN_IDENT) error: syntax error: syntax error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants