Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4260324
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T05:54:18+00:00 2026-05-21T05:54:18+00:00

I have an application using sockets.. a client and server program like mySql.. I

  • 0

I have an application using sockets.. a client and server program like mySql..

I am sending queries from the client to the server where the parser resides….

When i receive the query from the client at the server i write that query into a file and then set yyin to that file and call yyparse().. So this is how i parse the input string..

The problem is when a query is successfully executed the parser shows “syntax error”.. And when i looked at the file it had a non-readable character… So this means that parser is trying to parse that character and thus ends up giving a syntax error..

How do i remove this character from the file or just how do i stop the parser from parsing the character…

Here is what the output from the parser looks like:

----- 127.0.0.1 -----select nm from stud;�
--- end 127.0.0.1 ---
Select
Parsing done
Free    OK
1: syntax error

As you can see the 127.0.0.1 is the file name followed by its contents….
And there’s the mystery character after the semicolon…

See that the parser parses the query ( it outputs “Select” followed by “Parsing done” and “Free OK” ).. but then it gives this syntax error on line 1… i think its because of that character at the end of the line…

How do i solve this problem…

Thanks.. 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T05:54:18+00:00Added an answer on May 21, 2026 at 5:54 am

    If you just want to fix this one character, you can use a hex editor such as hexer to edit the file, find the one character that is funny, change it, save and re-run your parser. Maybe a more-standard editor such as vim can edit the file well, too, it’ll definitely be easier to modify the surroundings if you need to.

    You might want to filter the queries before saving them to disk; perhaps isalnum(3), isalpha(3), isgraph(3), or isprint(3) would be a useful sanity checking tool to inspect every character before saving them to disk. That way you could emit log entries at the time the bad input is provided, which might help you figure out why the client was sending you poorly formed input in the first place.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Java sockets for client - server application. I have a situation when
I have a client server application writter in C# .NET using Sockets. I often
I have written a server/client application using sockets in C# for .NET 3.5. I'm
I have a simple TCP socket client and server application. They are communicating using
I have a client/server style application which communicates using WCF which all works great.
I am writing an application that communicates using sockets. I have a server running
I would like to have a client-server application written in .NET which would do
I currently have an application that sends XML over TCP sockets from windows client
I have a client server application where I am using java serversocket(server side) and
I have an application using LINQ-to-SQL with SQL Server CE 4. I know that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.