Apitax/Core

Remove the import and export statements and instead using import to bring in other scripts

ShawnClake opened this issue · 1 comments

Import should now behave like this:
import openstack.networks;

Additionally, add in the 'as' keyword so that this can be done:
import openstack.networks as OpenstackNetworks;

  • This will add an entry to the symbol table tree. These imports lines should ONLY appear at the top of a file.

  • The symbol table tree node will look like:

    • label: OpenstackNetworks
    • type: script
    • attributes: None
    • value: {'driver': 'default', 'openstack.networks'}

Add the 'from' keyword so that a specific driver can be used to import a script.
If the 'from' keyword does not exist, it will use the default driver.

Examples:

  • from openstack import neutron.networks as NeutronNetworks;

    • Using the openstack driver, find the script (just to ensure it exists) neutron.networks (neutron/networks.ah) and import it with a symbol name of NeutronNetworks
  • The symbol table tree node will look like:

    • label: NeutronNetworks
    • type: script
    • attributes: None
    • value: {'driver': 'openstack', 'neutron.networks'}

The grammar might look like:
(FROM label)? IMPORT label (AS label)?

tested as working