# Copyright (c) 2022 Intel and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from PathNode import *


class Path:
    def __init__(self):
        self.stack = []

    def Create(token):
        try:
            path = Path()
            ss = token["stack"]

            if ss == None:
                return None

            for hct in ss:
                path.stack.append(PathNode.Create(hct))

            return path
        except:
            print("Failed to create Path from jsonfile")
            return None
