0

friends, I have a piece of code which can perform simple add, subtraction, multiplication, division, and formula with brackets.

Is there some kind of conversion tool for translating code from C to Smalltalk?

Or any other relatively easy way to achieve this?

Thanks in advance.

paxdiablo
  • 854,327
  • 234
  • 1,573
  • 1,953
parsifal
  • 879
  • 4
  • 12
  • 21
  • I don't know if there is a tool, but the order of operations is not directly compatible between C and Smalltalk. For example 1 + 2 * 3 returns different result. – user44556 Feb 17 '11 at 09:19
  • 1
    Maybe you could use your brains? – v1Axvw Feb 17 '11 at 21:08
  • This question seems closely related to a previous question by the OP http://stackoverflow.com/questions/5013028/how-can-i-parse-character-in-a-file-in-squeak4-1 – Alex Jasmin Feb 18 '11 at 01:47

2 Answers2

2

This should be trivial to write with PetitParser

Stephan Eggermont
  • 15,847
  • 1
  • 38
  • 65
1

There is an implementation of SWIG for Smalltalk. (SWIG is a software development tool that connects programs written in C and C++ with a variety of high-level programming languages).

Vijay Mathew
  • 26,737
  • 4
  • 62
  • 93