hello,
I'm working on a project that interprets a JavaScript file on a uC (NUCLEO_F446RE). The JerryScript doesn't need to have access to the pins directly because there are already working functions that are used to control the pins  in a specific way. 
I tested the library with the api-exaples [here](https://github.com/jerryscript-project/jerryscript/blob/master/docs/03.API-EXAMPLE.md) on my PC. They worked and I had no problems. I then tried to build the example for mbedos like it was described [here](https://github.com/ARMmbed/mbed-js-example) but it gave me errors. I would like to know if it's because it hasn't been updated since 2016 or if it's something on my part that I did wrong.

Mbed-os is installed in /opt/mbed

the problem arrived while executing 'gulp --target=NUCLEO_F446RE':
it couldn't execute this lines(34-36) in generate_pin.py:  
```
# import mbed tools
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'mbed-os'))
from tools.targets import Target
```
so I replaced `sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'mbed-os'))
`  with `sys.path.insert(0, '/opt/mbed-os')`

however it created another error that it couldn't find "./mbed" directory on line 179, so I created a link in the folder where generate_pin.py was to the mbed directory and that kinda fixed the problem in generate_pin.py. But it couldn't finish because there was an error like seen below and that was a rabbithole I didn't want to explore because I've been working on troubleshooting this for a week now and thought that someone more experienced in this matter would be able to hep me.

```
make[1]: Entering directory '/home/eric/Documents/mbed-testing/mbed-js-example/build/jerryscript/targets/mbedos5'
python tools/generate_pins.py NUCLEO_F446RE
Traceback (most recent call last):
  File "/home/eric/.local/lib/python3.8/site-packages/simpleeval.py", line 431, in _eval_name
    return self.names[node.id]
KeyError: 'PA_0'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "tools/generate_pins.py", line 250, in <module>
    main()
  File "tools/generate_pins.py", line 240, in main
    pins = enumerate_pins(pins_file, ['./tools'] + list(includes), defines)
  File "tools/generate_pins.py", line 161, in enumerate_pins
    return visitor.visit(parsed_ast)
  File "tools/generate_pins.py", line 110, in visit
    value = value or self.visit(child_node)
  File "tools/generate_pins.py", line 110, in visit
    value = value or self.visit(child_node)
  File "tools/generate_pins.py", line 106, in visit
    value = self.visit_typedecl(node)
  File "tools/generate_pins.py", line 137, in visit_typedecl
    pins[pin.name] = evaluator.eval(expr.strip())
  File "/home/eric/.local/lib/python3.8/site-packages/simpleeval.py", line 332, in eval
    return self._eval(ast.parse(expr.strip()).body[0].value)
  File "/home/eric/.local/lib/python3.8/site-packages/simpleeval.py", line 343, in _eval
    return handler(node)
  File "/home/eric/.local/lib/python3.8/site-packages/simpleeval.py", line 368, in _eval_binop
    return self.operators[type(node.op)](self._eval(node.left),
  File "/home/eric/.local/lib/python3.8/site-packages/simpleeval.py", line 343, in _eval
    return handler(node)
  File "/home/eric/.local/lib/python3.8/site-packages/simpleeval.py", line 443, in _eval_name
    raise NameNotDefined(node.id, self.expr)
simpleeval.NameNotDefined: 'PA_0' is not defined for expression 'PA_0 | ALT0'
make[1]: *** [Makefile:72: source/pins.cpp] Error 1
make[1]: Leaving directory '/home/eric/Documents/mbed-testing/mbed-js-example/build/jerryscript/targets/mbedos5'
make: *** [Makefile:14: all] Error 2
events.js:174
      throw er; // Unhandled 'error' event
      ^

Error: Command `make BOARD=NUCLEO_F446RE EXTRAS=` exited with code 2
    at ChildProcess.handleSubShellExit (/home/eric/Documents/mbed-testing/mbed-js-example/node_modules/gulp-run/command.js:166:13)
    at Object.onceWrapper (events.js:286:20)
    at ChildProcess.emit (events.js:198:13)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
Emitted 'error' event at:
    at errorOrDestroy (internal/streams/destroy.js:107:12)
    at onwriteError (_stream_writable.js:436:5)
    at onwrite (_stream_writable.js:461:5)
    at GulpRunner.afterTransform (_stream_transform.js:94:3)
    at ChildProcess.handleSubShellExit (/home/eric/Documents/mbed-testing/mbed-js-example/node_modules/gulp-run/command.js:169:14)
    at Object.onceWrapper (events.js:286:20)
    at ChildProcess.emit (events.js:198:13)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
```
Thank you very much for your help

###### Build platform
Ubuntu 20.04.2 LTS (Linux 5.8.0-50-generic x86_64)

mbed-os :  1.10.5
Python:  3.8.5
GNU Make: 4.2.1
Gulp: 
> CLI version: 2.3.0
> Local version: 3.9.1

Java:
>  openjdk version "1.8.0_282"
> OpenJDK Runtime Environment (build 1.8.0_282-b08)
> OpenJDK 64-Bit Server VM (build 25.282-b08, mixed mode)
mbed-js-example fails to build
This is a GitHub Issue
repo:jerryscript
owner:jerryscript-project
Title : mbed-js-example fails to build
Issue date:

--- start body ---
hello,
I'm working on a project that interprets a JavaScript file on a uC (NUCLEO_F446RE). The JerryScript doesn't need to have access to the pins directly because there are already working functions that are used to control the pins  in a specific way. 
I tested the library with the api-exaples [here](https://github.com/jerryscript-project/jerryscript/blob/master/docs/03.API-EXAMPLE.md) on my PC. They worked and I had no problems. I then tried to build the example for mbedos like it was described [here](https://github.com/ARMmbed/mbed-js-example) but it gave me errors. I would like to know if it's because it hasn't been updated since 2016 or if it's something on my part that I did wrong.

Mbed-os is installed in /opt/mbed

the problem arrived while executing 'gulp --target=NUCLEO_F446RE':
it couldn't execute this lines(34-36) in generate_pin.py:  
```
# import mbed tools
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'mbed-os'))
from tools.targets import Target
```
so I replaced `sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'mbed-os'))
`  with `sys.path.insert(0, '/opt/mbed-os')`

however it created another error that it couldn't find "./mbed" directory on line 179, so I created a link in the folder where generate_pin.py was to the mbed directory and that kinda fixed the problem in generate_pin.py. But it couldn't finish because there was an error like seen below and that was a rabbithole I didn't want to explore because I've been working on troubleshooting this for a week now and thought that someone more experienced in this matter would be able to hep me.

```
make[1]: Entering directory '/home/eric/Documents/mbed-testing/mbed-js-example/build/jerryscript/targets/mbedos5'
python tools/generate_pins.py NUCLEO_F446RE
Traceback (most recent call last):
  File "/home/eric/.local/lib/python3.8/site-packages/simpleeval.py", line 431, in _eval_name
    return self.names[node.id]
KeyError: 'PA_0'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "tools/generate_pins.py", line 250, in <module>
    main()
  File "tools/generate_pins.py", line 240, in main
    pins = enumerate_pins(pins_file, ['./tools'] + list(includes), defines)
  File "tools/generate_pins.py", line 161, in enumerate_pins
    return visitor.visit(parsed_ast)
  File "tools/generate_pins.py", line 110, in visit
    value = value or self.visit(child_node)
  File "tools/generate_pins.py", line 110, in visit
    value = value or self.visit(child_node)
  File "tools/generate_pins.py", line 106, in visit
    value = self.visit_typedecl(node)
  File "tools/generate_pins.py", line 137, in visit_typedecl
    pins[pin.name] = evaluator.eval(expr.strip())
  File "/home/eric/.local/lib/python3.8/site-packages/simpleeval.py", line 332, in eval
    return self._eval(ast.parse(expr.strip()).body[0].value)
  File "/home/eric/.local/lib/python3.8/site-packages/simpleeval.py", line 343, in _eval
    return handler(node)
  File "/home/eric/.local/lib/python3.8/site-packages/simpleeval.py", line 368, in _eval_binop
    return self.operators[type(node.op)](self._eval(node.left),
  File "/home/eric/.local/lib/python3.8/site-packages/simpleeval.py", line 343, in _eval
    return handler(node)
  File "/home/eric/.local/lib/python3.8/site-packages/simpleeval.py", line 443, in _eval_name
    raise NameNotDefined(node.id, self.expr)
simpleeval.NameNotDefined: 'PA_0' is not defined for expression 'PA_0 | ALT0'
make[1]: *** [Makefile:72: source/pins.cpp] Error 1
make[1]: Leaving directory '/home/eric/Documents/mbed-testing/mbed-js-example/build/jerryscript/targets/mbedos5'
make: *** [Makefile:14: all] Error 2
events.js:174
      throw er; // Unhandled 'error' event
      ^

Error: Command `make BOARD=NUCLEO_F446RE EXTRAS=` exited with code 2
    at ChildProcess.handleSubShellExit (/home/eric/Documents/mbed-testing/mbed-js-example/node_modules/gulp-run/command.js:166:13)
    at Object.onceWrapper (events.js:286:20)
    at ChildProcess.emit (events.js:198:13)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
Emitted 'error' event at:
    at errorOrDestroy (internal/streams/destroy.js:107:12)
    at onwriteError (_stream_writable.js:436:5)
    at onwrite (_stream_writable.js:461:5)
    at GulpRunner.afterTransform (_stream_transform.js:94:3)
    at ChildProcess.handleSubShellExit (/home/eric/Documents/mbed-testing/mbed-js-example/node_modules/gulp-run/command.js:169:14)
    at Object.onceWrapper (events.js:286:20)
    at ChildProcess.emit (events.js:198:13)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
```
Thank you very much for your help

###### Build platform
Ubuntu 20.04.2 LTS (Linux 5.8.0-50-generic x86_64)

mbed-os :  1.10.5
Python:  3.8.5
GNU Make: 4.2.1
Gulp: 
> CLI version: 2.3.0
> Local version: 3.9.1

Java:
>  openjdk version "1.8.0_282"
> OpenJDK Runtime Environment (build 1.8.0_282-b08)
> OpenJDK 64-Bit Server VM (build 25.282-b08, mixed mode)
--- end body ---
